The objective of ParkourJSON is to provide a concise, typed, non-verbose, and declarative way of implementing a JSON API server without the need for code generation (an unnecessary and annoying step).
A 'JSON API' in this sense is an API that:
- Only responds to JSON-formatted requests.
- Only responds with JSON-formatted responses.
Simply clone or fork this project.
Forking is recommended to allow for downstream merging of future improvements.
After cloning or forking, see the sample API implementation in the src
directory.
To create a new project based on this framework, do not use the 'fork' feature of GitHub. Instead, follow these steps:
-
On GitHub, create a new empty repository (let's call this the project repo).
-
git clone
the project repo locally andcd
into it. -
Add this repository as an upstream remote to the local project repo clone, we will name the remote
framework
.:git remote add framework https://github.com/ParkourOps/parkour-json
-
Create a local branch on the project repo clone called
framework
which will reflect themain
branch of this repository.git fetch framework main git checkout -b framework --track framework/main
-
Create the
main
branch on the project repo.git checkout -b main git push -u origin main
-
Install the Node dependencies and get developing!
npm install
In order of precedent:
-
Implement global middleware.
-
Implement an OPTIONS handler on all possible routes which should respond with concise representation of the API good enough to be used as user documentation.
-
Implement unit tests.
-
Implement functional tests.
-
Documentation!
-
Improve typing to further improve development experience.