mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
register @services
alias
This commit is contained in:
parent
724b0e9d0f
commit
b9168b8f19
@ -1,8 +1,10 @@
|
|||||||
|
import path from "path"
|
||||||
import { Server, registerBaseAliases } from "linebridge/dist/server"
|
import { Server, registerBaseAliases } from "linebridge/dist/server"
|
||||||
|
|
||||||
registerBaseAliases()
|
registerBaseAliases(undefined, {
|
||||||
|
"@services": path.resolve(process.cwd(), "src/services"),
|
||||||
|
})
|
||||||
|
|
||||||
import path from "path"
|
|
||||||
import express from "express"
|
import express from "express"
|
||||||
import bcrypt from "bcrypt"
|
import bcrypt from "bcrypt"
|
||||||
import passport from "passport"
|
import passport from "passport"
|
||||||
@ -46,7 +48,7 @@ export default class API {
|
|||||||
eventBus = global.eventBus = new EventEmitter()
|
eventBus = global.eventBus = new EventEmitter()
|
||||||
|
|
||||||
storage = global.storage = createStorageClientInstance()
|
storage = global.storage = createStorageClientInstance()
|
||||||
|
|
||||||
jwtStrategy = global.jwtStrategy = {
|
jwtStrategy = global.jwtStrategy = {
|
||||||
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||||
secretOrKey: process.env.SERVER_TOKEN ?? "secret",
|
secretOrKey: process.env.SERVER_TOKEN ?? "secret",
|
||||||
@ -54,7 +56,7 @@ export default class API {
|
|||||||
expiresIn: process.env.signLifetime ?? "1h",
|
expiresIn: process.env.signLifetime ?? "1h",
|
||||||
enforceRegenerationTokenExpiration: false,
|
enforceRegenerationTokenExpiration: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.server.engine_instance.use(express.json())
|
this.server.engine_instance.use(express.json())
|
||||||
this.server.engine_instance.use(express.urlencoded({ extended: true }))
|
this.server.engine_instance.use(express.urlencoded({ extended: true }))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user