mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
commit
81abc75b1f
9650
package-lock.json
generated
9650
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -6,11 +6,17 @@
|
||||
"scripts": {
|
||||
"build": "node ./build.js ./build",
|
||||
"serve": "node ./server.js ./build 3000",
|
||||
"test": "npm run build && npm run serve"
|
||||
"test": "npm run build && npm run serve",
|
||||
"hot": "concurrently \"nodemon --exec npm test\" \"await tcp localhost:3000 && open-cli http://localhost:3000\""
|
||||
},
|
||||
"author": "Lospec",
|
||||
"license": "ISC",
|
||||
"nodemonConfig": {
|
||||
"ext": "js,hbs,scss",
|
||||
"ignore": "build/"
|
||||
},
|
||||
"dependencies": {
|
||||
"concurrently": "^6.0.2",
|
||||
"express": "^4.16.4",
|
||||
"fs-extra": "^7.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
@ -20,7 +26,12 @@
|
||||
"gulp-sass": "^4.0.2",
|
||||
"handlebars-helper-svg": "git+https://bitbucket.org/skeddles/npm-handlebars-helper-svg-lospec-open-source.git",
|
||||
"nodemon": "^2.0.7",
|
||||
"open": "^6.0.0",
|
||||
"open": "^8.0.6",
|
||||
"open-cli": "^6.0.1",
|
||||
"sass": "^1.17.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"reload": "^3.1.1",
|
||||
"wait-cli": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
22
server.js
22
server.js
@ -1,6 +1,6 @@
|
||||
const path = require('path');
|
||||
const express = require('express');
|
||||
|
||||
const reload = require('reload');
|
||||
const app = express();
|
||||
|
||||
const BUILDDIR = process.argv[2] || './build';
|
||||
@ -13,6 +13,11 @@ app.get('/', (req, res) => {
|
||||
console.log('error sending file', err);
|
||||
} else {
|
||||
console.log("Server: Successfully served index.html");
|
||||
setTimeout(()=>{
|
||||
console.log('closing server');
|
||||
res.app.server.close();
|
||||
process.exit();
|
||||
},1000*10);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -20,14 +25,9 @@ app.get('/', (req, res) => {
|
||||
//ROUTE - other files
|
||||
app.use(express.static(path.join(__dirname, BUILDDIR)));
|
||||
|
||||
//start server
|
||||
var server = app.listen(PORT, () => {
|
||||
console.log(`\nTemp server started at http://localhost:${PORT}!`);
|
||||
//console.log('press ctrl+c to stop ');
|
||||
|
||||
var opn = require('open');
|
||||
|
||||
// opens the url in the default browser
|
||||
opn(`http://localhost:${PORT}`);
|
||||
reload(app).then(() => {
|
||||
//start server
|
||||
app.server = app.listen(PORT, function () {
|
||||
console.log('Web server listening on port ' + PORT)
|
||||
})
|
||||
});
|
||||
|
||||
|
@ -621,5 +621,6 @@
|
||||
|
||||
</script>
|
||||
<script src="/pixel-editor/pixel-editor.js"></script>
|
||||
<script src="/reload/reload.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user