This app is meant to serve as a quick-start for fellows to clone into and build on top of.
If you will be pushing it to Heroku you will need to set your node engine version in package.json
.
To set your node engine version:
- Go to the terminal, iTerm, or VSCode terminal and run
node -v
- Copy the output from the last command and paste it into your
package.json
, in"engines.node"
- Navigate to the directory where you want this app to live
- Clone the repo:
git clone https://github.com/joinpursuit/basic-express-app.git
- Create your own repo on Github
- Navigate to the cloned repo from step 2 (should be
cd ./basic-express-app
) - Reset the
origin
remote to now reference your newly created repo from step 3 (git remote set-url origin git://your.new.url.here
) - Confirm this worked by running
git remote -v
. The output should match your new repo - Further confirm by pushing to your new remote and seeing the changes in the repo on Github
- You can now delete the README.md in your repo, or make it your own by overwriting its content :)
- You can rename the directory from
basic-express-app
to whatever you like by using themv
command like so:mv ./basic-express-app ./my-own-directory-name
. This command is expecting you to be at the same level as the parent ofbasic-express-app
. So if you runls
and don't seebasic-express-app
you'll need to tweak the command.
- Add a
.env
file, and write the following in it:PORT=3001
(you can change the port number) - Run
npm i
(ornpm install
, same thing) to create yournode_modules
- Run
npm start
- this runsnodemon server.js
- Navigate to
http://localhost:3001
, you should be seeing "Basic Express App - ROOT" in your browser