https://github.com/petehouston/dart-json-server
Launch JSON server for web and mobile apps development from CLI without complicated backend setup for Dart and Flutter development.
https://github.com/petehouston/dart-json-server
cli cli-app command-line dart dart-cli dart-package dart-server dart2 dartlang flutter hacktoberfest webdev
Last synced: about 1 year ago
JSON representation
Launch JSON server for web and mobile apps development from CLI without complicated backend setup for Dart and Flutter development.
- Host: GitHub
- URL: https://github.com/petehouston/dart-json-server
- Owner: petehouston
- License: mit
- Created: 2019-11-01T06:26:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-04T03:57:35.000Z (over 6 years ago)
- Last Synced: 2025-05-12T19:12:02.255Z (about 1 year ago)
- Topics: cli, cli-app, command-line, dart, dart-cli, dart-package, dart-server, dart2, dartlang, flutter, hacktoberfest, webdev
- Language: Dart
- Homepage: https://pub.dev/packages/json_server
- Size: 35.2 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# JSON Server
Launch JSON server for web and mobile apps development from CLI without complicated backend setup.
## Installation
You can install the package from the command line:
```sh
$ pub global activate json_server
```
## Usage
The CLI is named `jserver`.
```
jserver --data=
```
Available options you can use:
* `-d, --data`: path to JSON database file. **Required**.
* `-h, --host`: specify the IP address to serve. Default to `127.0.0.1`.
* `-p, --port`: specify the port to use. Default to `1711`.
### JSON Format
Typically, for JSON database, you need to use following structure.
```json
{
"API_PATH_1": RESPONSE_OBJECT_1,
"API_PATH_2": RESPONSE_OBJECT_2,
}
```
**API_PATH** must start with a slash `/` to mark it as a serving path for API.
**RESPONSE_OBJECT**: should be either `Array` or `Object`.
### Examples
To start a default server, which binds to `127.0.0.1:1711`, using `database.json`.
```
$ jserver -d database.json
```
To start server at `localhost:8888` using `api.json` for database.
```
$ jserver -h localhost -p 8888 -d api.json
```
# LICENSE
[MIT](LICENSE.md) @ 2019 [Pete Houston](https://petehouston.com).