forked from nonesrc/roach
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroach.ts
More file actions
32 lines (29 loc) · 1.15 KB
/
roach.ts
File metadata and controls
32 lines (29 loc) · 1.15 KB
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
import RoachServer from './server'
import RoachConfig from './config'
import chalker from './utils/chalker'
// RoachRouter Middleware
import cookieParser from './router/middleware/cookieParser'
// Plugins
import ccAuth from './plugin/core/ccAuth'
import easyAuth from './plugin/core/easyAuth'
import eduAuth from './plugin/core/eduAuth'
import ssoAuth from './plugin/core/ssoAuth'
import eduSystem from './plugin/extra/eduSystem'
import healthMark from './plugin/extra/healthMark'
const roachServer = new RoachServer()
// Install roachRouter middlewares
roachServer.roachRouter.use(cookieParser)
// Install plugins
roachServer.roachPluginLoader.install(ccAuth)
roachServer.roachPluginLoader.install(easyAuth)
roachServer.roachPluginLoader.install(eduAuth)
roachServer.roachPluginLoader.install(ssoAuth)
roachServer.roachPluginLoader.install(eduSystem)
roachServer.roachPluginLoader.install(healthMark)
roachServer.listen(RoachConfig.serverPort, () => {
// eslint-disable-next-line
console.clear()
roachServer.roachPluginLoader.process()
// eslint-disable-next-line
console.log(chalker.success.bold`Roach crawling on http://localhost:${RoachConfig.serverPort}`)
})