Skip to content
James edited this page Aug 15, 2020 · 12 revisions

Getting Started **WIP**

These instructions are to help you get set up locally. We will need to change the instructions as we migrate away from using Compass(a css framework/compiler that uses Ruby) to using a compiler that will work with Node.js. Without running compass, the API will still work, however the homepage will just show our markup/markdown without any styling. So, unless you're working on a ticket that involves the front-end and styling, we can get away with ignoring compass for now. The server will just show a homepage without styling.

dependencies and installation

You must have Node.js installed on your machine and be able to use npm. To install the Node dependencies, here are the instructions:

  1. Fork/Clone the repository.
  2. Run cd numbers_api to get into the home directory of the repository.
  3. Run npm install to install the Node dependencies.
  4. Run touch secrets.js and let this file be blank for now. This is needed because in /app.js on line 16, secrets is being imported but no file exists. This is to prevent errors when starting the server. Alternatively, you can comment out line 16.

Compiling the CSS

  1. In the home directory of the repo, run compass compile public/ to generate the CSS for the front end.
  2. Do not commit the .scssc files to git.

starting/stopping the server

If you have nodemon installed(highly preferred), run nodemon. Otherwise, follow the instructions below.

To get get the API server started(with an un-styled homepage), here are the instructions:

  1. Run npm start to run the start script. This will start the Node/Express server in the background. In other words, your terminal window will close, but the server will still run in the background.
  2. Visit http://localhost:8124/ . The site may run with warnings in the terminal in the background, and these may be ignored for now.
  3. To stop the server, run npm stop. This runs the stop script to stop the server running in the background.
Clone this wiki locally