'use strict'; const Hapi = require('@hapi/hapi'); const fs = require('fs') const init = async () => { const server = Hapi.server({ port: 8033, host: 'localhost' }); server.route({ method: 'GET', path: '/', handler: (request, h) => { const spec = JSON.parse(fs.readFileSync('../build/spec.json')) return spec } }); await server.start(); console.log('Server running on %s', server.info.uri); }; process.on('unhandledRejection', (err) => { console.log(err); process.exit(1); }); init();