| 1234567891011121314151617181920212223 |
- const Hapi = require('@hapi/hapi');
- const Database = require('./config/database');
- const init = async () => {
- const server = Hapi.server({
- port: 8000,
- host: 'localhost'
- });
-
- Database.connect();
- await server.register([
- // { plugin: require('./routes/posts') },
- { plugin: require('./routes/index') },
- ]);
- await server.start();
- console.log('Listening on %s', server.info.uri);
- }
- init();
|