Issue TS2705: The use of async functions or methods in ES5/ES3 requires the 'Promise' constructor. Please ensure that you have included a declaration for the 'Promise' constructor or added 'ES2015' to your --lib
option.
import * as Hapi from 'hapi';
import * as IConfig from 'config';
const config = JSON.parse(JSON.stringify(IConfig));
const serverConnections = config.server,
server: Hapi.Server = new Hapi.Server(serverConnections);
export module Server {
export const start = async () => {
server.route({
path: '/',
method: 'GET',
handler(request, h) {
return "hello!!!"
},
});
console.log('serverstart')
server.start();
}
}