-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.tsx
40 lines (32 loc) · 962 Bytes
/
Application.tsx
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
/* eslint-disable no-console */
import './Application.css'
import Nullstack, {
NullstackClientContext,
NullstackServerContext,
} from 'nullstack'
import AccessCount from './AccessCount'
import KeysTable from './KeysTable'
class Application extends Nullstack {
static async prepareServer(context?: any) {
const { server } = context as NullstackServerContext
console.log(`Server port set from .env: ${server.port}`)
console.log(`process.env.COMMON_VARIABLE: ${process.env.COMMON_VARIABLE}`)
}
async prepare({ page, project }: NullstackClientContext) {
page.title = project.name
await Application.prepareServer()
}
render({ settings }: NullstackClientContext) {
const headerTitle = `${
settings.disableCount !== 'true' ? 'Enabled' : 'Disabled'
} Count`
return (
<main>
<KeysTable />
<h2>{headerTitle}</h2>
<AccessCount />
</main>
)
}
}
export default Application