-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
39 lines (32 loc) · 1.76 KB
/
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
34
35
36
37
38
39
process.__dirname = __dirname
const express = require("express")
const socketIo = require("socket.io")
const http = require("http")
const path = require("path")
const { startTunnel } = require("./utils/tunnel")
const app = express()
const server = http.createServer(app)
const IO = new socketIo.Server(server)
app.use(express.static(path.join(__dirname, "public")))
app.use(express.urlencoded({ extended: false }))
app.set("views", path.join(__dirname, "views"))
app.set("view engine", "ejs")
app.use(express.json())
global.IO = IO
app.use("/", require("./router/index"))
app.use("/t", require("./router/target"))
const PORT = process.env.PORT || 3441
server.listen(PORT, async () => {
console.log(`
██╗ ██╗███████╗██╗ ██╗███╗ ███╗ ██████╗ ███╗ ██╗
██║ ██╔╝██╔════╝╚██╗ ██╔╝████╗ ████║██╔═══██╗████╗ ██║
█████╔╝ █████╗ ╚████╔╝ ██╔████╔██║██║ ██║██╔██╗ ██║
██╔═██╗ ██╔══╝ ╚██╔╝ ██║╚██╔╝██║██║ ██║██║╚██╗██║
██║ ██╗███████╗ ██║ ██║ ╚═╝ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
- Madhanmaaz
- https://madhanmaaz.netlify.app
`)
await startTunnel()
console.log(`RUNNING ON: http://127.0.0.1:${PORT}`)
})