Skip to content

Instantly share code, notes, and snippets.

@Nishchit14
Last active June 17, 2018 09:16
Show Gist options
  • Save Nishchit14/5caca2aad21e31b91ff055f1256b9d0d to your computer and use it in GitHub Desktop.
Save Nishchit14/5caca2aad21e31b91ff055f1256b9d0d to your computer and use it in GitHub Desktop.
Express vs Koa vs Hapi - Server setup
//Expressjs server setup
const express = require('express');
const app = express();
let server = app.listen(3000, ()=> {
console.log('Express is listening to http://localhost:3000');
});
//Koajs server setup
const koa = require('koa');
const app = koa();
let server = app.listen(3000, ()=> {
console.log('Koa is listening to http://localhost:3000');
});
//Hapijs server setup
const hapi = require('hapi');
const server = new hapi.Server(3000);
server.start(()=> {
console.log('Hapi is listening to http://localhost:3000');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment