getOptionServer()
Last updated 3/09/2025
Example
The following code gets the Bearer Token from the Server Options field stored against the instance record, using the key
accessToken
.
Gets the accessToken value
const accessToken = five.getOptionServer('accessToken');
const secret = five.headers.Authorization;
if (secret !== `Bearer ${accessToken}`) {
return five.createError('Access denied');
}