ADD file watcher
This commit is contained in:
parent
379e7b26e2
commit
19448fe85b
@ -2,13 +2,13 @@
|
||||
"name": "best-resume-ever",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"server": "node --harmony-async-await src/server.js",
|
||||
"less": "node --harmony-async-await src/compileLess.js",
|
||||
"babel": "babel --presets es2015 src/javascript.js -o public/javascript.js",
|
||||
"readme": "node --harmony-async-await src/renderReadMe.js",
|
||||
"start": "npm run babel && npm run less && npm run server",
|
||||
"dev": "watch 'npm start' src/ resumes/ less/",
|
||||
"pdf": "node --harmony-async-await src/htmlToPdf.js"
|
||||
},
|
||||
"pre-commit": [
|
||||
@ -28,6 +28,7 @@
|
||||
"babel-preset-es2015": "^6.22.0",
|
||||
"buffer-to-string": "^0.1.0",
|
||||
"clean-css": "^4.0.4",
|
||||
"concurrently": "^3.2.0",
|
||||
"electroshot": "^1.2.0",
|
||||
"express": "^4.14.1",
|
||||
"font-awesome": "^4.7.0",
|
||||
@ -49,8 +50,11 @@
|
||||
"path": "^0.12.7",
|
||||
"pre-commit": "^1.2.2",
|
||||
"raleway-webfont": "^3.0.1",
|
||||
"request": "^2.79.0",
|
||||
"request-promise": "^4.1.1",
|
||||
"roboto-fontface": "^0.7.0",
|
||||
"showdown": "^1.6.3",
|
||||
"watch": "^1.0.1",
|
||||
"write": "^0.3.2"
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ const fs = require('fs');
|
||||
const person = require('./person.js');
|
||||
const express = require('express');
|
||||
const mustacheExpress = require('mustache-express');
|
||||
const request = require('request-promise');
|
||||
const port = 3000;
|
||||
|
||||
let app = express();
|
||||
app.set('views', path.join(__dirname, '../resumes'));
|
||||
@ -37,6 +39,8 @@ app.get('/', (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/kill', () => process.exit());
|
||||
|
||||
for (let resume of directories) {
|
||||
app.get('/' + resume, (req, res) => {
|
||||
res.render('views/layout', {
|
||||
@ -48,4 +52,10 @@ for (let resume of directories) {
|
||||
});
|
||||
}
|
||||
|
||||
app.listen(3000, '0.0.0.0', () => console.log('Listening on localhost:3000!'));
|
||||
|
||||
request.get('http://localhost:' + port + '/kill')
|
||||
.catch(error => {});
|
||||
|
||||
setTimeout(() => {
|
||||
app.listen(port, '0.0.0.0', () => console.log('Listening on localhost:' + port + '!'));
|
||||
}, 500);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user