Closed tuutoo closed 4 years ago
I have found a solution and it works now. :D
in api.js
const fs = require('fs') ... ... let server = Hapi.Server({ port: 3001, tls: { key: fs.readFileSync('/your_ssl_key_path/privkey.pem'), cert: fs.readFileSync('/your_ssl_key_path/fullchain.pem') }, routes: { validate: { failAction: async (request, h, err) => { RestHapi.logger.error(err); throw err; } } } })
@tuutoo glad you worked it out. Thanks for sharing! ;)
Is it possible start the server with https protocol? I have my SSL certificates but don't know how to configure to use https.