Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```