Fullstacking: Setting up NodeJS + KoaJS
(Source/Credits: https://dev.to/heymarkkop/fullstacking-setting-up-nodejs-koajs-2jhb)
NodeJS sudo apt install curl curl -sL https://deb.nodesource.com/setup_10.x | sudo -E ba...
NodeJS
bash
sudo apt install curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install nodejs
node --version
npm --version
KoaJS
yarn add koa
or npm install koa
Create a file (koa.js) and paste the following:
```javascript
const Koa = require('koa');
const app = new Koa();
app.use(async ctx => { ctx.body = 'Hello World'; });
app.listen(3000, () => console.log('Running on http://localhost:3000/')); ``` Check http://localhost:3000 Great, it's working!
Comments section