-
Notifications
You must be signed in to change notification settings - Fork 3
/
server.js
33 lines (25 loc) · 828 Bytes
/
server.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
const express = require("express");
const app = express();
const server = require("http").Server(app);
const io = require("socket.io")(server);
const cors = require("cors");
app.use(express.json());
app.use(cors());
// include router /admin
app.use("/admin", require("./routes/adminRouter"));
// include router /pemateri
app.use("/pemateri", require("./routes/pemateriRouter"));
// include router /workshop
app.use("/workshop", require("./routes/workshopRouter"));
//include router /status
app.use("/status", require("./routes/statusRouter"));
// include router /autentikasi
app.use("/autentikasi", require("./routes/autentikasiRouter"));
// listen socket
io.on("connection", function(socket) {
require("./socket")(io, socket);
});
// start server
server.listen(3000, function() {
console.log("server running");
});