Giter VIP home page Giter VIP logo

static-heroku-nodejs's Introduction

static-heroku-nodejs

Step-by-step guide:

  1. Start new app and git init it.
  2. Go to Heroku and sign up there.
  3. On your apps page click on "Create a new app".
  4. Copy Heroku Git URL and add it to your app using git remote add heroku your-git-url.
  5. Create sample index.html file.
  6. In order to serve html files Heroku needs to start some web server. It can be nodejs, ruby or whatever language is supported by platform. In case of this tutorial you will use built-in nodejs http package web server. Sample implementation of web server, that can only serve static html files is app.js file. It just try to read requested html file and if this file exists write its content to response. Locally server can be started by node app.js command (you need nodejs installed).
  7. Heroku doesn't know anything about your app.js file. In order to notify it, you need to create Procfile consisting of only line of code web: node app.js.
  8. Now you need to create package.json file and the easiest way to do it is use npm install command. Just press enter few times - you don't to change anything.
  9. Now commit all changes and push it to Heroku using git push heroku master.
  10. Go to your app page on Heroku website and click on little rectangle with arrow near the name of your application. It will open your static application. That's it!

static-heroku-nodejs's People

Contributors

yankovsky avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.