1
0
Fork 0

Static site serving via npm start

This commit is contained in:
Joe Wroten 2019-05-12 11:30:16 -05:00
parent 8c6e4536b4
commit 2c4092df16
4 changed files with 88 additions and 0 deletions

12
index.js Normal file
View file

@ -0,0 +1,12 @@
var static = require('node-static');
var fileServer = new static.Server('./public');
require('http').createServer(function (request, response) {
request.addListener('end', function () {
fileServer.serve(request, response);
}).resume();
}).listen(8080);
console.log('Serving on http://localhost:8080');
console.log('Should be proxied to https://basking.wroten.me/');

53
package-lock.json generated Normal file
View file

@ -0,0 +1,53 @@
{
"name": "basking-dashboard",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"colors": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz",
"integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==",
"dev": true
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"dev": true
},
"minimist": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
"dev": true
},
"node-static": {
"version": "0.7.11",
"resolved": "https://registry.npmjs.org/node-static/-/node-static-0.7.11.tgz",
"integrity": "sha512-zfWC/gICcqb74D9ndyvxZWaI1jzcoHmf4UTHWQchBNuNMxdBLJMDiUgZ1tjGLEIe/BMhj2DxKD8HOuc2062pDQ==",
"dev": true,
"requires": {
"colors": ">=0.6.0",
"mime": "^1.2.9",
"optimist": ">=0.3.4"
}
},
"optimist": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
"dev": true,
"requires": {
"minimist": "~0.0.1",
"wordwrap": "~0.0.2"
}
},
"wordwrap": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
"integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
"dev": true
}
}
}

23
package.json Normal file
View file

@ -0,0 +1,23 @@
{
"name": "basking-dashboard",
"version": "0.0.1",
"description": "Dashboard for my personal home server ",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sharpshark28/basking-dashboard.git"
},
"author": "Jo Wroten <jo@wroten.me>",
"license": "UNLICENSED",
"bugs": {
"url": "https://github.com/sharpshark28/basking-dashboard/issues"
},
"homepage": "https://github.com/sharpshark28/basking-dashboard#readme",
"devDependencies": {
"node-static": "^0.7.11"
}
}