- Cloner ce repo
- Placer le contenu à servir dans le dossier public/
- Commit
- Ajouter le remote heroku (https://git.heroku.com/mon-projet.git)
- Git push heroku master
- Sur heroku.com, ajouter votre sous-domaine pour votre application
- Faire un CNAME vers mon-projet.herokuapp.org
Created
April 23, 2015 03:39
-
-
Save edorgeville/afea5b70fbf74311cc71 to your computer and use it in GitHub Desktop.
Comment avoir un serveur rapido presto pour servir du contenu static avec Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules/ | |
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var static = require('node-static'); | |
var file = new static.Server('./public'); | |
var port = process.env.PORT || 8080; | |
require('http').createServer(function (request, response) { | |
request.addListener('end', function () { | |
file.serve(request, response); | |
}).resume(); | |
}).listen(port); | |
console.log('Listening on port ' + port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Mon projet", | |
"version": "1.0.0", | |
"description": "Mon projet est vraiment un beau projet.", | |
"dependencies": { | |
"node-static": "^0.7.6" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: node app.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment