generated from apostrophecms/starter-kit-assembly-essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
50 lines (48 loc) · 2.05 KB
/
app.js
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
import multisite from '@apostrophecms-pro/multisite';
import { sdk } from './telemetry.js';
import sites from './sites/index.js';
import dashboard from './dashboard/index.js';
go();
async function go() {
try {
if (process.env.APOS_OPENTELEMETRY) {
await sdk.start();
}
await multisite({
root: import.meta,
// Default port, for dev
port: 3000,
websocket: true,
// Change this to a hardcoded string when forking to make a new project.
// Just set it to a string which should never change. Ideally should match
// your repo name followed by a -, however if you plan to use a
// cheap Atlas cluster (below M10), you must use a unique prefix less
// than 12 characters (before the -).
shortNamePrefix: process.env.APOS_PREFIX || 'a3hpab-',
// Suffix, used only for building hostnames and not affecting
// e.g. database names. For example, if you set this to `-assembly`,
// and your short name is `site`, the hostname for that site would be
// `site-assembly.your-domain.com`, and your dashboard would become available
// at `dashboard-assembly.your-domain.com`.
shortNameSuffix: '',
// Used to separate the locale name from the short name in hostnames.
// For example, if you set this to `-` and your short name is `site`,
// the hostname for the `fr` locale with "Separate Host" enabled,
// would be `fr-site.your-domain.com`.
localeSeparator: '.',
// You may set the dashboard short name to a different value than the default
// 'dashboard'. For example if set to `admin`, the dashboard would be
// available at `https://admin.yourdomain.com`.
dashboardShortName: process.env.APOS_DASHBOARD_SHORTNAME || 'dashboard',
// For development. An environment variable overrides this in staging/production
mongodbUrl: 'mongodb://localhost:27017',
sessionSecret: 'CHANGEME',
sites,
dashboard
});
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
process.exit(1);
}
}