-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
30 lines (25 loc) · 875 Bytes
/
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
var gui = require( '../../' ) // stand alone: replace with require( 'easy-web-app' )
// define a main page
var mainPage = gui.init( 'Modal Message Demo', 8011, 'demo' )
mainPage.addView( { 'id':'v1', 'title':'Blank', 'height':'300px' } )
mainPage.title = 'Home'
mainPage.header.logoText = 'Modal Message Demo'
// after page load:
// define to check the resource `demo/message` for a message to display
mainPage.header.modules.push( {
id : 'PgMesg',
type : 'pong-message',
param : { resourceURL: 'demo/message' }
} )
gui.getExpress().get( '/demo/message', async ( req, res ) => {
// if no message should appear:
// res.status( 200 ).json( null )
// return data for page message
res.status( 200 ).json( {
title : 'Test',
html : 'Hello World',
width : 200,
height : 200,
buttonTxt : 'Okey-dokey'
})
})