Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/everlastingbugstopper/jserv
A development server for a single JSON file
https://github.com/everlastingbugstopper/jserv
Last synced: 17 days ago
JSON representation
A development server for a single JSON file
- Host: GitHub
- URL: https://github.com/everlastingbugstopper/jserv
- Owner: EverlastingBugstopper
- Created: 2023-04-03T20:36:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-12T18:48:48.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T15:44:47.723Z (9 months ago)
- Language: JavaScript
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `jserv`
`jserv` is a development server for a single JSON file.
The main reason to choose this package over a generic echo server is because it will parse your JSON file and print line and column numbers for any errors it encounters.
## Usage
**Serve a single json file from all endpoints:**
`npx jserv ./examples/data.json`
Changes made to the file will be reloaded and served.
**Customize the host/port of the server:**
`npx jserv --port 4000 --host localhost ./data.json`
## Example error
```sh
$ npx jserv@latest ./examples/bad.json✖️ error: invalid JSON at ./examples/bad.json:3:28
☞ Unexpected token , in JSON at position 40
```