-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.js
27 lines (22 loc) · 913 Bytes
/
start.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
const express = require('express');
const livereload = require('metalsmith-livereload');
const watch = require('glob-watcher');
const smith = require('./build');
const build = (clean = false) => (done) => {
smith(clean, false)
.use(livereload({
//debug: true,
script: '<script src="http://localhost:35729/livereload.js?snipver=1"></script>'
}))
.build((err, files) => {
let filenames = Object.keys(files).join(', ');
console.log('Built: ' + filenames);
done(err);
});
};
const app = express();
app.use('/folkeregisteret-api-dokumentasjon', express.static(__dirname + '/docs'));
app.get('/', (req, res) => res.redirect('/folkeregisteret-api-dokumentasjon'));
app.listen(4567);
console.log('Server started on http://localhost:4567');
watch(['./src/**/*', './layouts/**/*'], { ignoreInitial: false }, build(true));