https://github.com/jonlabelle/serve-json
A simple HTTP server for static JSON files.
https://github.com/jonlabelle/serve-json
express json nodejs serve
Last synced: about 2 months ago
JSON representation
A simple HTTP server for static JSON files.
- Host: GitHub
- URL: https://github.com/jonlabelle/serve-json
- Owner: jonlabelle
- License: mit
- Created: 2024-11-08T04:31:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T22:12:01.000Z (over 1 year ago)
- Last Synced: 2025-01-17T13:28:32.214Z (over 1 year ago)
- Topics: express, json, nodejs, serve
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serve JSON

> A simple HTTP server for static JSON files. Simply drop your JSON files in the [`src/data`](src/data) directory and start serving!
Check out the [sample JSON file](src/data/sample.json) that comes with the project, or [start the server](#starting-the-server) to browse the files in the `data/` directory.

## Installation
### Installation Steps
To install the project, clone the repo and install the dependencies:
```console
# Clone the repo
git clone https://github.com/jonlabelle/serve-json.git
# Change to the repo directory
cd serve-json
# Install dependencies
npm install
```
### Starting the Server
To start the server, run the following command:
```console
npm serve
```
## Container
### Running in a Container
To run the server in a container, build the image and run the container:
```console
# Build the image
docker|podman|nerdctl build -t serve-json .
# Run the container
docker|podman|nerdctl run -p 3000:3000 serve-json
```
## License
[MIT](LICENSE)