fake-jason

command module
v0.0.0-...-ade126d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 15 Imported by: 0

README

Fake-Jason

fake-jason is a handy cli tool for front-end developers to mock up a back-end in a snap, making it easier for devs to test and prototype without any hassle.

routes

Route Description
GET / List database tables.
GET /{table} List a certain table records.
POST /{table} Add a record to a given table.
PUT /{table}/{id} Edit a record by id.
DELETE /{table}/{id} Delete a record from a table.
GET /{table}/{id} Retrieve a record from a table by id.

Filtering and sorting

Operation Route Description Example
Filtering GET /{table}?col={}&val={} Search through a given table, based on a column value GET /posts?col=author&val=Jane+Doe
Sorting GET /{table}?sort={} sort a table based on a column, for descending sorting append the column name with a "-" GET /posts?sort=-id

CLI arguments

Argument Default Description
db ./db.json the path to the json databse.
port :4000 the port the server will be listening to.

Local usage

git clone https://github.com/aymenhta/fake-json
cd fake-json
go build -ldflags='-s' -o=./bin/ .
cd bin
./cmd --db ../db.json

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL