-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (19 loc) · 739 Bytes
/
app.js
File metadata and controls
25 lines (19 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const express = require('express')
const app = express()
const path = require('path')
// Defining port number
const PORT = 3000;
// Function to serve all static files
// inside public directory.
app.use(express.static('public'));
app.use('/Images', express.static('Images'));
app.use('/sounds', express.static('sounds'));
app.use('/models', express.static('models'));
app.use('/css', express.static('css'));
app.use(express.static(__dirname + '/public'))
app.use('/build/', express.static(path.join(__dirname, 'node_modules/three/build')));
app.use('/jsm/', express.static(path.join(__dirname, 'node_modules/three/examples/jsm')));
// Server setup
app.listen(PORT, () => {
console.log(`Running server on PORT ${PORT}...`);
})