Skip to content

Commit 7830cc2

Browse files
authored
Create Express.md
1 parent 8caba72 commit 7830cc2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Express.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Express
2+
3+
## Serving static pages
4+
5+
Create a folder named `www` in the project's root directory and place static e.g `.html` pages there.
6+
7+
Launch your web server example `node server.js`
8+
9+
Create a file called `server.js` and add the following code.
10+
11+
```javascript
12+
const express = require('express');
13+
const app = express();
14+
15+
app.use(express.static(__dirname + '/www'));
16+
17+
app.listen('3000');
18+
console.log('working on 3000');
19+
```

0 commit comments

Comments
 (0)