# Step 1

#### Initialize the new Node JS project.

```bash
$ npm init -y
$ npm install -S express
```

The first command will create a "package.json" file.  This file gives NodeJS all the information it needs to know about your project, including what dependencies it needs.

The second command installs a package called "[express](https://github.com/expressjs/express)", which is a very popular framework for creating web servers.

#### Let's create a Web API

Create a folder called "src", and inside that, create a file called "index.js". In this file, put the following:

```javascript
const express = require('express');

const PORT = process.env.PORT || 5000;
const app = express();

app.listen(PORT, () => {
	console.log(`Listening on port: ${PORT}`);
});
```

And that's it! With just 8 lines of code, you have created an HTTP server that listens for requests on port 5000.&#x20;

Let's run our app! Open "package.json" and put the following in the "scripts" section:

```
...
    "main": "src/index.js",
	"scripts": {
		"start": "node src/index.js",
		"test": "echo \"Error: no test specified\" && exit 1"
	},
	"repository": {
....
```

&#x20;It doesn't do anything important right now, but that will come in step 2.
