-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
61 lines (59 loc) · 1.32 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
49
50
51
52
53
54
55
56
57
58
59
60
61
var handlebars = require('handlebars');
var fs = require('fs');
var data = {
'Address': 'string',
'ApplicationId': 'string',
'Attributes': {
'OrderNumber': [
'14286','45361','13892','12580','14382'
],
'OrderAmount': [
'380.35','378.63','558.05','788.75','252.05'
],
'ItemCount': [
'20','20','32','35','41'
]
},
'ChannelType': 'EMAIL',
'CohortId': 'string',
'CreationDate': 'string',
'Demographic': {
'AppVersion': 'string',
'Locale': 'string',
'Make': 'string',
'Model': 'string',
'ModelVersion': 'string',
'Platform': 'string',
'PlatformVersion': 'string',
'Timezone': 'string'
},
'EffectiveDate': 'string',
'EndpointStatus': 'string',
'Id': 'string',
'Location': {
'City': 'string',
'Country': 'string',
'Latitude': 123.0,
'Longitude': 123.0,
'PostalCode': 'string',
'Region': 'string'
},
'Metrics': {
'string': 123.0
},
'OptOut': 'string',
'RequestId': 'string',
'User': {
'UserAttributes': {
'string': [
'string',
]
},
'UserId': 'string'
}
}
fs.readFile('index.html', 'utf-8', function(error, source){
var template = handlebars.compile(source);
var html = template(data);
console.log(html)
});