-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.config.ts
More file actions
41 lines (38 loc) · 1.09 KB
/
stack.config.ts
File metadata and controls
41 lines (38 loc) · 1.09 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
33
34
35
36
37
38
39
40
41
export type Framework = 'express' | 'fastify' | 'hono'
export type ORM = 'drizzle' | 'prisma'
export type Database = 'postgres' | 'sqlite'
export interface StackConfig {
framework: Framework
orm: ORM
database: Database
port: number
postgres: {
host: string
port: number
database: string
user: string
password: string
poolSize: number
}
sqlite: {
path: string
}
}
const config: StackConfig = {
framework: (process.env.FRAMEWORK as Framework) || 'fastify',
orm: (process.env.ORM as ORM) || 'drizzle',
database: (process.env.DATABASE as Database) || 'postgres',
port: parseInt(process.env.PORT || '3000', 10),
postgres: {
host: process.env.POSTGRES_HOST || 'localhost',
port: parseInt(process.env.POSTGRES_PORT || '5432', 10),
database: process.env.POSTGRES_DB || 'serverlab',
user: process.env.POSTGRES_USER || 'postgres',
password: process.env.POSTGRES_PASSWORD || 'postgres',
poolSize: parseInt(process.env.POOL_SIZE || '10', 10),
},
sqlite: {
path: process.env.SQLITE_PATH || './data/serverlab.db',
},
}
export default config