-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
23 lines (18 loc) · 719 Bytes
/
server.js
File metadata and controls
23 lines (18 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended:true}));
app.use("/lib",express.static(path.join(__dirname,'/lib')))
app.use("/js",express.static(path.join(__dirname,'/js')));
app.use("/css",express.static(path.join(__dirname,'/css')))
app.use("/textures",express.static(path.join(__dirname,'/textures')))
app.use("/models",express.static(path.join(__dirname,'/models')))
app.get('/',(req,res)=>{
res.sendFile(path.join(__dirname+'/index.html'));
})
app.set('port',5000);
const server = app.listen(app.get('port'),()=>{
console.log("Server is running");
});