- Make a directory
- Change into the directory
- Create a file called
index.js
- Install the Express package with
npm install express
- Copy and paste the Express Server Code
- Run your server with
node index.js
- Look at what's being served up at localhost:3000
- Make a change to serve JSON instead of text
change app.get('/', (req, res) => res.send('Hello World!'))
to
app.get('/', (req, res) => res.json({message: 'Hello World!'}))