Deploy static files (HTML/CSS/JS) on Heroku
Published in
1 min readSep 21, 2018
Heroku is primarily aimed to serve the server level requirements. In general, Heroku support to deploy only these type of applications:
Clearly, static files (defaults to index.html) can’t be served directly on Heroku. So we need to transform static web app into any of these supported web apps. The simplest alternative is to use Node.js environment.
Here we have a better and simplest option to serve static files on Heroku.
- Add
package.json
file in the root directory. - Add this code in your
package.json
file:
3. That’s it. Your project is ready to be deployed on Heroku.
serve
is a very minimal node package, that is used to serve static files on node server.