Giter VIP home page Giter VIP logo

cse341-week03's Introduction

Application Flow
----------------------------------------------------------

Folder flow:
Root Folder > routes > controllers > views

File flow:
app.js > homeRoute.js > homeController.js > indexView.ejs


Heroku with mongoDB
----------------------------------------------------------
Every Heroku app has its own Heroku-hosted Git repo.
You deploy new versions of your app by pushing your code changes to this repo.
In order to do that, your local Git repo needs to know the URL of the Heroku-hosted repo.

Heroku's architecture requires the use of config vars.
Express calls .listen(PORT), which makes use of the Heroku config var.
Using || to initialize PORT's value to the first defined variable.
When app is run on Heroku, process.env.PORT is defined and passed to .listen().
Running locally, the config var is undefined and the localhost port is passed to .listen().

Basic Commands:
sudo npm install -g heroku
heroku plugins:install heroku-repo
heroku login
heroku git:remote -a cse341nodejsapp
git push heroku master:main
heroku ps:scale web=1

heroku logs --tail
heroku repo:reset --app appname

https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment
https://devcenter.heroku.com/articles/heroku-cli#download-and-install
https://devcenter.heroku.com/articles/git#tracking-your-app-in-git
https://devcenter.heroku.com/articles/deploying-nodejs

cse341-week03's People

Contributors

cnreina 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.