-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
41 lines (30 loc) · 826 Bytes
/
server.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
require('marko/node-require').install()
require('lasso/node-require-no-op').enable('.css')
require('marko/browser-refresh').enable()
require('lasso/browser-refresh').enable('*.marko *.css')
const Main = require('./src/pages/main')
const express = require('express')
const compression = require('compression')
const serveStatic = require('serve-static')
const outputDir = `${__dirname}/static`
require('lasso').configure({
plugins: [
'lasso-marko'
],
outputDir,
bundlingEnabled: true,
minify: false,
fingerprintsEnabled: false
})
const app = express()
const port = 8080
app.use(compression())
app.use('/static', serveStatic(outputDir))
app.get('/', function (req, res) {
Main.stream({ count: 45 }).pipe(res)
})
app.listen(port, function () {
if (process.send) {
process.send('online')
}
})