GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Back-end2/src/index.ts at develop · Team-O2/Back-end2

Expand file tree

/

index.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
87 lines (74 loc) · 1.93 KB
/

index.ts

Copy path

File metadata and controls

87 lines (74 loc) · 1.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import express from "express";
import config from "./config";
import cors from "cors";
import { sequelize } from "./models";
import router from "./router";
import path from "path";
import schedulerService from "./service/schedulerService";
// sequelize
// .sync({ alter: true })
// // .sync({ force: false })
// .catch((error) => {
// console.error(error);
// });
const app = express();
const morgan = require("morgan");
const nunjucks = require("nunjucks");
sequelize.sync({ force: false }).catch((error) => {
console.error(error);
});
app.use(express.urlencoded());
app.use(express.json());
// Port Host
const PORT: number = parseInt(process.env.PORT as string, 10) || 8080;
const HOST: string = process.env.HOST || "localhost";
// allow cors
app.use(
cors({
credentials: true,
origin: [
"http://localhost:3000",
"https://dev.opentogether-o2.com",
"https://www.opentogether-o2.com",
],
})
);
// route
app.use("/", router);
app.set("view engine", "ejs");
app.set("view", path.join(__dirname, "views"));
// error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get("env") === "production" ? err : {};
// render the error page
res.status(err.status || 500);
res.render("error");
// scheduler
schedulerService.challengeOpen;
});
const server = app
.listen(PORT, () => {
console.log(
`
################################################
🛡️ Server listening on port: ${PORT} 🛡️
################################################
`
);
sequelize
// .sync({ alter: true })
.authenticate()
.then(async () => {
console.log("MySQL Connected ...");
})
.catch((err) => {
console.log("TT : ", err);
});
})
.on("error", (err) => {
console.error(err);
process.exit(1);
});
server.timeout = 1000000;
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.