Skip to content

Commit 7eabd02

Browse files
committed
Create server in root
1 parent 25b65a1 commit 7eabd02

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

server.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const express = require('express');
2+
3+
const app = express();
4+
const http = require('http');
5+
6+
app.use('/public', express.static(__dirname.concat('/public')));
7+
app.get('/', (_req, res) => {
8+
res.sendFile(__dirname.concat('/index.html'));
9+
res.status(200);
10+
});
11+
12+
http.createServer(app).listen(3000, () => {
13+
console.log('Server running on port 3000');
14+
});

0 commit comments

Comments
 (0)