multy-stub/server/index.js

76 lines
2.5 KiB
JavaScript
Raw Normal View History

2023-08-01 13:14:02 +03:00
const express = require('express')
const bodyParser = require('body-parser')
const cookieParser = require('cookie-parser')
const session = require('express-session')
const app = express()
const cors = require('cors')
require('dotenv').config()
const config = require('../.serverrc')
const { setIo } = require('./io')
app.use(cookieParser())
app.options('*', cors())
app.use(cors())
const server = setIo(app)
const sess = {
secret: 'super-secret-key',
resave: true,
saveUninitialized: true,
cookie: {
},
}
if (app.get('env') === 'production') {
app.set('trust proxy', 1)
sess.cookie.secure = true
}
app.use(session(sess))
app.use(bodyParser.json({
limit: '50mb',
}))
app.use(bodyParser.urlencoded({
limit: '50mb',
extended: true,
}))
app.use(require('./root'))
/**
* Добавляйте сюда свои routers.
*/
2023-08-04 14:22:10 +03:00
app.use('/lobsters', require('./routers/lobsters'))
2023-08-01 13:14:02 +03:00
app.use('/example', require('./routers/example'))
// app.use('/coder', require('./routers/coder'))
2023-11-25 11:55:44 +03:00
//app.use('/stc-21-03', require('./routers/stc-21-03'))
//app.use('/stc-21', require('./routers/stc'))
//app.use('/stc-22-24', require('./routers/stc-22-24'))
2023-08-01 13:14:02 +03:00
// app.use('/bushou-api', require('./routers/bushou'))
// app.use('/uryndyklar-api', require('./routers/uryndyklar'))
// app.use('/neptunium', require('./routers/neptunium'))
// app.use('/music-learn', require('./routers/music-learn'))
// app.use('/publicium', require('./routers/publicium'))
// app.use('/task-boss', require('./routers/task-boss'))
// app.use('/car-wash', require('./routers/car-wash'))
app.use('/zoom-bar', require('./routers/zoom-bar'))
2024-05-18 13:40:25 +03:00
app.use('/r-and-m', require('./routers/r-and-m'))
2024-05-24 05:04:31 +03:00
app.use('/my', require('./routers/my'))
2024-05-19 03:04:19 +03:00
app.use('/edateam', require('./routers/edateam'))
2024-05-22 15:11:46 +03:00
app.use('/webstar-project', require('./routers/webstar-project'))
app.use('/dogsitters-finder', require('./routers/dogsitters-finder'))
2024-05-30 17:39:33 +03:00
app.use('/dhs-testing', require('./routers/dhs-testing'))
2024-06-01 19:53:28 +03:00
app.use('/kazan-explore', require('./routers/kazan-explore'))
2023-11-25 11:55:44 +03:00
//app.use('/basket', require('./routers/basket'))
//app.use('/easy-project', require('./routers/easy-project'))
//app.use('/sugarbun', require('./routers/sugarbun'))
2023-11-20 18:58:08 +03:00
app.use('/epja-2023-2', require('./routers/epja-2023-2'))
2023-08-01 13:14:02 +03:00
require('./routers/hub-video')
2024-05-31 16:38:40 +03:00
app.use('/school-stage', require('./routers/school-stage'))
2024-10-10 13:06:58 +03:00
app.use('/epja-2024-1', require('/routers/epja-2024-1'))
2023-08-01 13:14:02 +03:00
app.use(require('./error'))
server.listen(config.port, () => console.log(`Listening on http://localhost:${config.port}`))