Last active
November 24, 2017 12:11
-
-
Save daxeh/12a791fcd6ee8d4f3962de4fe6730c7c to your computer and use it in GitHub Desktop.
Adhoc NodeJS static server
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
heroku login | |
heroku create your-app-name | |
## Existing .git | |
git push heroku master | |
## create instance | |
heroku ps:scale web=1 | |
## your-app-name.herokuapp.com | |
heroku open |
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
yarn add node-static | |
// index.js | |
var static = require('node-static'); | |
var file = new static.Server(); | |
require('http').createServer(function(request, response) { | |
request.addListener('end', function() { | |
file.serve(request, response); | |
}).resume(); | |
}).listen(process.env.PORT || 3000); | |
// Git | |
git init | |
git add . | |
git commit -am "initial commit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment