UNPKG

nopalm

Version:

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

15 lines (12 loc) 299 B
import Koa from 'koa'; const app = new Koa(); app.use(async (ctx) => { if (ctx.path === '/ping' && ctx.method === 'GET') { ctx.body = 'Hello World!'; } else { ctx.status = 404; } }); app.listen(4000, () => { console.log('Koa running at http://localhost:4000'); });