https://github.com/xkeshav/mock
mock server : A file based customized mock server based on json server
https://github.com/xkeshav/mock
Last synced: about 1 month ago
JSON representation
mock server : A file based customized mock server based on json server
- Host: GitHub
- URL: https://github.com/xkeshav/mock
- Owner: xkeshav
- License: mit
- Created: 2024-10-15T11:58:35.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-15T12:40:22.000Z (7 months ago)
- Last Synced: 2025-03-25T18:23:29.920Z (about 1 month ago)
- Language: TypeScript
- Size: 425 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
- Support: .github/SUPPORT.md
- Governance: .github/GOVERNANCE.md
Awesome Lists containing this project
README
# JSON Server DEMO
A json-server which auto updated and folder based endpoints
## How To start
run
> npm install
then
> npm run start
now open **** and server will be visible
## How it works
create any json file inside **mock/json** directory and server will add the respective json with endpoint
you can edit the json file while running server and it will update without restarting
Alternative approach
> npm run start:port -- -port 4001
json server will start on port 4001 but it will not update the json runtime.
## routing
routing added so response also be accessible with api prefix for eg. _/api/_
file name with separated by `-` can be accessible with `/`
## examples
- **hello-world.json** file data can be accessible at `http://localhost:3003/hello/world`
- _user.json_ data can be accessed at `http://localhost:3003/user` and `http://localhost:3003/api/user`
- folder can be nested under **json** folder and data is accessible at folder-file-name route
for eg. _json/auth/login.json_ data can be accessible at
`http://localhost:3003/auth-login` and `http://localhost:3003/api/auth-login`## Notes
all request are **GET** by default, no POST and other verb can be used while accessing
## Screenshots
### Running server in window

### display landing page in Chrome
