mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-25 13:15:02 +02:00
access token endpoints and other backend support
This commit is contained in:
parent
283fb3990c
commit
72dc02ff2e
22 changed files with 905 additions and 107 deletions
|
@ -4,29 +4,34 @@ import cors from "cors";
|
|||
import cookieParser from "cookie-parser";
|
||||
import config from "@server/config";
|
||||
import logger from "@server/logger";
|
||||
import { errorHandlerMiddleware, notFoundMiddleware } from "@server/middlewares";
|
||||
import {
|
||||
errorHandlerMiddleware,
|
||||
notFoundMiddleware
|
||||
} from "@server/middlewares";
|
||||
import internal from "@server/routers/internal";
|
||||
|
||||
const internalPort = config.server.internal_port;
|
||||
|
||||
export function createInternalServer() {
|
||||
const internalServer = express();
|
||||
const internalServer = express();
|
||||
|
||||
internalServer.use(helmet());
|
||||
internalServer.use(cors());
|
||||
internalServer.use(cookieParser());
|
||||
internalServer.use(express.json());
|
||||
internalServer.use(helmet());
|
||||
internalServer.use(cors());
|
||||
internalServer.use(cookieParser());
|
||||
internalServer.use(express.json());
|
||||
|
||||
const prefix = `/api/v1`;
|
||||
internalServer.use(prefix, internal);
|
||||
const prefix = `/api/v1`;
|
||||
internalServer.use(prefix, internal);
|
||||
|
||||
internalServer.use(notFoundMiddleware);
|
||||
internalServer.use(errorHandlerMiddleware);
|
||||
internalServer.use(notFoundMiddleware);
|
||||
internalServer.use(errorHandlerMiddleware);
|
||||
|
||||
internalServer.listen(internalPort, (err?: any) => {
|
||||
if (err) throw err;
|
||||
logger.info(`Internal server is running on http://localhost:${internalPort}`);
|
||||
});
|
||||
internalServer.listen(internalPort, (err?: any) => {
|
||||
if (err) throw err;
|
||||
logger.info(
|
||||
`Internal server is running on http://localhost:${internalPort}`
|
||||
);
|
||||
});
|
||||
|
||||
return internalServer;
|
||||
}
|
||||
return internalServer;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue