-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
48 lines (45 loc) · 1.26 KB
/
index.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
process.env.DEFAULT_CONTENT_TIMEOUT = "70000";
process.env.GLOBAL_REQUEST_TIMEOUT = "75000";
const PuzzleJs = require('@puzzle-js/core');
const path = require('path');
const fs = require('fs');
const storefront = new PuzzleJs.Storefront({
serverOptions: {
port: 4445,
https: {
key: fs.readFileSync(path.join(__dirname, '/secrets/key.pem')),
cert: fs.readFileSync(path.join(__dirname, '/secrets/cert.pem'))
}
},
gateways: [
{
name: 'platform-gw',
url: 'http://localhost:4444/',
},
{
name: 'browsing-gw',
url: 'https://localhost:4443/',
}
],
pages: [
{
name: 'homepage',
url: '/',
html: fs.readFileSync(path.join(__dirname, './pages/main.html'), 'utf8')
},
{
name: 'about',
url: '/about',
html: fs.readFileSync(path.join(__dirname, './pages/about.html'), 'utf8')
},
{
name: 'photo',
url: '/photo/:id',
html: fs.readFileSync(path.join(__dirname, './pages/photo.html'), 'utf8')
}
],
dependencies: []
});
storefront.init(() => {
console.log('Storefront is ready to respond');
});