-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
44 lines (32 loc) · 953 Bytes
/
app.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const express = require('express')
const app = express()
const port = 3000
const route = __dirname + '/views/404.html'
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendFile(__dirname + '/views/index.html');
})
app.get('/noScript.html', function(req, res) {
res.sendFile(__dirname + '/views/noScript.html');
})
app.get('/unknownLanguage.html', function(req, res) {
res.sendFile(__dirname + '/views/unknownLanguage.html');
})
app.get('/previewPage.html', function(req, res) {
res.sendFile(__dirname + '/views/previewPage.html')
})
app.get('/languages.json', function(req, res) {
res.sendFile(route);
})
app.get('/main.js', function(req, res) {
res.sendFile(route);
})
app.get('/copy.js', function(req, res) {
res.sendFile(route);
})
app.use(function(req, res, next) {
res.status(404).sendFile(route);
});
app.listen(port, () => {
console.log(`Porta: http://localhost:${port}`)
})