UNPKG

nopalm

Version:

One stop graphical solution to create and manage your local Node.Js projects end to end.

27 lines (21 loc) 494 B
const Hapi = require('@hapi/hapi'); const init = async () => { const server = Hapi.server({ port: 4000, host: 'localhost' }); server.route({ method: 'GET', path: '/ping', handler: (request, h) => { return 'Hello World!'; } }); await server.start(); console.log('Hapi running at http://localhost:4000'); }; process.on('unhandledRejection', (err) => { console.log(err); process.exit(1); }); init();