Skip to content

Commit

Permalink
ajout d'un mini serveur pour fichier statiques lançable avec npm start.
Browse files Browse the repository at this point in the history
  • Loading branch information
1000i100 committed Feb 28, 2017
1 parent 0bcfb85 commit 5408c4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -11,7 +11,9 @@
"build.stylus": "stylus --compress staticApp/style.styl build/style.built.css",
"build.assets": "",
"build.cleaning": "",
"build.test": ""
"build.test": "",
"srv": "node srv/index.js",
"start": "npm run srv"
},
"repository": {
"type": "git",
Expand All @@ -33,13 +35,14 @@
"homepage": "https://1twitif.github.io/social-viz/",
"dependencies": {
"d3": "^4.5.0",
"express": "^4.14.1",
"js-yaml": "^3.8.1",
"requirejs": "^2.3.2"
},
"devDependencies": {
"bithound": "^1.7.0",
"codacy-coverage": "^2.0.1",
"codeclimate-test-reporter": "^0.4.1",
"codeclimate-test-reporter": "^0.4.1",
"jasmine": "^2.5.3",
"karma": "^1.4.1",
"karma-chrome-launcher": "^2.0.0",
Expand All @@ -49,6 +52,7 @@
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-requirejs": "^1.1.0",
"openurl": "^1.1.1",
"stylus": "^0.54.5"
}
}
17 changes: 17 additions & 0 deletions srv/index.js
@@ -0,0 +1,17 @@
const express = require('express');
const app = express();

app.use(express.static('./'));

/*app.get('/', function (req, res) {
res.send('Hello World!')
})*/

app.listen(3000, function () {
console.log('Version local utilisable ici : http://localhost:3000/');
try{
require("openurl").open("http://localhost:3000/");
} catch(e){
console.log("openurl non disponnible");
}
});

0 comments on commit 5408c4b

Please sign in to comment.