You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I've upgraded an old Nodejs project to the latest Hapi version... I've read your documentation but I got this error when I start the Nodejs application...
Here's my code
const init = async () => {
const server = Hapi.server({
port: port,
host: 'localhost',
routes: { cors: { credentials: true } }
});
// include our module here ↓↓, for example, require('hapi-auth-jwt2')
await server.register(require('hapi-auth-jwt2'));
server.auth.strategy('jwt', 'jwt',
{
key: 'SECRETKEYIHAVE',
validateFunc: Auth.login_validate,
verifyOptions: { algorithms: ['HS256'] }// validate function defined above
});
server.auth.default('jwt');
server.route(routes);
await server.start();
logger.info('Server running on %s', server.info.uri);
return server;
};
process.on('unhandledRejection', (err) => {
logger.error(err.message);
process.exit(1);
});
init();
Hello,
I've upgraded an old Nodejs project to the latest Hapi version... I've read your documentation but I got this error when I start the Nodejs application...
Here's my code
and here's my package.json
Any suggestion?
Thanks in advance
The text was updated successfully, but these errors were encountered: