-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathindex.ts
36 lines (31 loc) · 894 Bytes
/
index.ts
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
import { runSetupFunctions } from "./setup";
import { createApiServer } from "./apiServer";
import { createNextServer } from "./nextServer";
import { createInternalServer } from "./internalServer";
import { Session, User, UserOrg } from "./db/schema";
async function startServers() {
await runSetupFunctions();
// Start all servers
const apiServer = createApiServer();
const internalServer = createInternalServer();
const nextServer = await createNextServer();
return {
apiServer,
nextServer,
internalServer,
};
}
// Types
declare global {
namespace Express {
interface Request {
user?: User;
session?: Session;
userOrg?: UserOrg;
userOrgRoleId?: number;
userOrgId?: string;
userOrgIds?: string[];
}
}
}
startServers().catch(console.error);