An Express/Node.js based implementation of the AutoRenter API.
These instructions will cover usage information for the API.
- Make sure the project is at a location with minimal file path length (this is especially important in a Windows environment!). For this project we strongly recommend
c:/aur/api
as the project root. - Install Git.
- Install Node (tested on version 6.2.2)
- Unless otherwise noted, all terminal commands must be issued from the project's root directory.
npm install
npm run lint
Note that this will lint the code before running tests. No tests will run if lint errors are found.
npm test
To start the API with all debug logging enabled (recommended):
npm start
After successfully starting the API app, you should be able to view data by browsing to (localhost:3000/api/locations). For more in-depth testing, use a web debugging tool such as Fiddler or Postman.
The following steps describe the recommended development workflow.
- Pull from the
development
branch. - As described above:
- Install project libraries.
- Run tests.
- Start the API.
- Browse the API.
If you encounter problems with any of this, please see the Troubleshooting section, below.
If you are implementing a new feature, in addition to the previous steps you should:
- Create a feature branch by branching off of
development
. - Implement your feature. Note that during this process you should regularly (at least 1x/day) merge the
development
branch into your feature branch to ensure your code is staying current with work being done by the rest of the team.- Develop
- Make changes to code, scripts, unit tests, etc.
- Lint your code.
- Run the tests.
- Browse the API.
- Repeat until you have something meaningful to commit to your feature branch.
- Commit changes to your feature branch.
- Repeat these feature implementation steps until the feature is ready to review.
- Develop
- Open a pull request to merge your feature branch into
development
.
- Re-run
npm install
to verify that your dependencies are up to date.
When starting the API with npm start
, all log messages will be displayed. To fine tune logging, set a specific logging level using the LOGGER_LEVEL
environment variable or config value:
In non-window environments:
LOGGER_LEVEL="warn" node server
In windows:
set LOGGER_LEVEL="warn"
node server
Sometimes you just need to completely clean your development environment before starting over from the beginning. The following commands will help you start from a "clean slate":
# Blow away the node_modules folder:
rm -rf node_modules
To see all the internal logs used in Express, set the DEBUG environment variable to express:* when launching your app.
DEBUG=express:* node index.js
On Windows, use the corresponding command.
set DEBUG=express:* & node index.js
To see the logs only from the router implementation set the value of DEBUG to express:router. Likewise, to see logs only from the application implementation set the value of DEBUG to express:application, and so on.
This section contains additional information about the development environment.
LOGGER_LEVEL
- Set the logging level- Examples:
error
warn
info
verbose
debug
silly
- Examples:
HOST
- Sets the API server hostPORT
- Sets the API server port
/server
- API source/tests
- Test source
Please read the CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Allen Buckley - Initial work
- Ray Clanan - Initial work
- Jarred Keuch - Initial work
- Devashri Oza - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
- Fusion Alliance for the initiative to create a community of open source development within our ranks.