UNPKG

fastify-scaffold

Version:

I write a fair number of web apps that use `fastify` (as a web server), `marko` (for templating), and `lasso` (for asset bundling).

18 lines (15 loc) 446 B
'use strict' require('require-self-ref') const app = require('~/lib/app.js') const log = require('~/lib/logger.js')() app.start() .then(function (fastify) { log.info('server listening on port %s', fastify.server.address().port) process.on('SIGINT', function() { log.info('SIGINT caught, shutting fastify down gracefully') fastify.close(process.exit) }) }) .catch(function (err) { console.error(err.stack) })