-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathproject.js
More file actions
38 lines (33 loc) · 1.14 KB
/
project.js
File metadata and controls
38 lines (33 loc) · 1.14 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
import { ICONS } from 'nullstack/project'
import environment from './environment'
import worker from './worker'
import { getCurrentContext } from './context'
const project = {}
project.domain = process.env.NULLSTACK_PROJECT_DOMAIN
project.name = process.env.NULLSTACK_PROJECT_NAME
project.shortName = process.env.NULLSTACK_PROJECT_SHORT_NAME
project.color = process.env.NULLSTACK_PROJECT_COLOR
project.viewport = process.env.NULLSTACK_PROJECT_VIEWPORT || 'width=device-width, initial-scale=1, shrink-to-fit=no'
project.type = 'website'
project.display = 'standalone'
project.orientation = 'portrait'
project.scope = '/'
project.root = '/'
project.sitemap = environment.mode === 'ssg'
project.favicon = '/favicon-96x96.png'
project.disallow = []
project.icons = ICONS
function getHost() {
const currentContext = getCurrentContext()
if (currentContext.request?.headers?.host) {
return currentContext.request.headers.host
}
if (project.domain === 'localhost') {
return `localhost:${process.env.NULLSTACK_SERVER_PORT}`
}
return project.domain
}
export function generateBase() {
return `${worker.protocol}://${getHost()}`
}
export default project