-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (21 loc) · 786 Bytes
/
server.js
File metadata and controls
30 lines (21 loc) · 786 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
26
27
28
29
30
const express = require('express');
const app = express();
const path = require('path');
const router = express.Router();
const port = 8080;
app.use(express.static('frontend'));
//Funcion que retorna la página de la aplicación
app.get("/", (req, res) => {
return res.sendFile(path.join(__dirname + '/frontend/index.html'));
});
app.get("/report", (req, res) => {
return res.sendFile(path.join(__dirname + '/frontend/report.html'));
});
app.get("/game", (req, res) => {
return res.sendFile(path.join(__dirname + '/frontend/game.html'));
});
app.get("/message", (req, res) => {
return res.sendFile(path.join(__dirname + '/frontend/message.html'));
});
//Iniciar la aplicación
app.listen(port, () => console.log(`Aplicación iniciada en el puerto ${port}...`));