text: const path = require('path');
  
  // Read the .env file.
  require('dotenv').config({
     path: path.join(__dirname, '..', `.${process.env.NODE_ENV}.env`),
  });
  
  // Require the framework
  const Fastify = require('fastify');
  
  // Require library to exit fastify process, gracefully (if possible)
  const closeWithGrace = require('close-with-grace');
  
  // Instantiate Fastify with some config
  const app = Fastify({
     logger: true,
  });
  
  // Register your application as a normal plugin.
  const appService = require('./app.js');
  
  app.register(appService);
  
  // delay is the number of milliseconds for the graceful close to finish
  const closeListeners = closeWithGrace({ delay: 500 }, async ({ err }) => {
     if (err) {
        app.log.error(err);
     }
     await app.close();
  });
  
  app.addHook('onClose', async (instance, done) => {
     closeListeners.uninstall();
     done();
  });
  
  // Start listening.
  app.listen(process.env.PORT || 3000, '0.0.0.0', (err) => {
     if (err) {
        app.log.error(err);
        process.exit(1);
     }
  });
  