-
Notifications
You must be signed in to change notification settings - Fork 366
/
types.ts
64 lines (56 loc) · 1.65 KB
/
types.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Buffer } from 'buffer'
import { IncomingMessage } from 'http'
import { Match } from 'netlify-redirector'
export type FrameworkNames = '#static' | '#auto' | '#custom' | string
export type FrameworkInfo = {
build: {
directory: string
}
dev: {
commands: string[]
port: number
pollingStrategies: { name: string }[]
}
name: FrameworkNames
staticAssetsDirectory: string
env: NodeJS.ProcessEnv
plugins?: string[]
}
export type BaseServerSettings = {
baseDirectory?: string
dist?: string
/** The command that was provided for the dev config */
command?: string
/** If it should be served like static files */
useStaticServer?: boolean
/** A port where a proxy can listen to it */
frameworkPort?: number
/** The host where a proxy can listen to it */
frameworkHost?: '127.0.0.1' | '::1'
functions?: string
/** The framework name ('Create React App') */
framework?: string
env?: NodeJS.ProcessEnv
pollingStrategies?: string[]
plugins?: string[]
clearPublishDirectory?: boolean
}
export type ServerSettings = BaseServerSettings & {
/** default 'secret' */
jwtSecret: string
/** default 'app_metadata.authorization.roles' */
jwtRolePath: string
/** The port where the dev server is running on */
port: number
/** The port where the functions are running on */
functionsPort: number
https?: { key: string; cert: string; keyFilePath: string; certFilePath: string }
clearPublishDirectory?: boolean
skipWaitPort?: boolean
}
export interface Request extends IncomingMessage {
originalBody?: Buffer | null
protocol?: string
hostname?: string
}
export type Rewriter = (req: Request) => Match | null