Closed OtavioSC closed 1 year ago
Using the koajs documentation, we could implement a simple node server like this:
//server.ts import Koa from "koa"; const app = new Koa(); export default app.use(async ctx => { ctx.body = 'Hello World'; });
and a file to start the server:
//index.ts import app from './server' dotenv.config() // change to env variable app.listen(process.env.PORT, async () => { console.log('Server is running') })
Each file in a src folder on server app directory
nice
Using the koajs documentation, we could implement a simple node server like this:
and a file to start the server:
Each file in a src folder on server app directory