const fastify = require('fastify')({
https: {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
}
})
const fastify = require('fastify')({
https: {
key: fs.readFileSync('/path/to/key.pem'),
cert: fs.readFileSync('/path/to/cert.pem')
}
})
fastify.get('/', (request, reply) => {
reply.send({ hello: 'world' })
})
fastify.listen({ port: 3000 }, (err) => {
if (err) {
console.error(err)
process.exit(1)
}
console.log('Server running at https://localhost:3000')
})