JSON files as endpoints.
- Place your
.json
files in a folder so that the path matches the desired endpoint - You can organize the files via the method (GET, POST, ...) if you prefer
Default folder is
json
if not specified.
- If you need endpoints like this:
/endpoint
/folder/to/endpoint
/my/get/endpoint
/my/post/endpoint
- So make a source directory like this:
json
├── endpoint.json
├── folder
│ └── to
│ └── endpoint.json
├── GET
│ └── my
│ └── get
│ └── endpoint.json
└── POST
└── my
└── post
└── endpoint.json
Download from releases and unzip json-filepoints.js.
# Default port and source directory
node json-filepoints.js
# Change port with -p
node json-filepoints.js -p <port>
# Change source directory with -d
node json-filepoints.js -d <folder>
git clone https://github.com/eduhds/json-filepoints.git
cd json-filepoints
yarn build
node build/json-filepoints.js
Alternatively you can run
yarn start
oryarn dev
docker run --rm -p 3030:3030 -v $(pwd)/json:/json eduhds/json-filepoints -d /json
curl http://localhost:3030/folder/to/endpoint
This project is intended to test purposes like mocking api's. Don't use in production.