Skip to content

Repository files navigation

json-db-api

last commitversiondownloadslicenseHitCount

Simple JSON API server inspired by jsonbase/myjson

Install

# install json-db-api
npm i -g json-db-api
# migrate database
json-db-api --database db.sqlite3 --migrate

Run

# specify database (db.sqlite3 by default)
json-db-api --database my-sqlite-database.sqlite3
# specify port (3000 by defautl)
json-db-api --port 8080
# log as json instead of pino-pretty
json-db-api --notpretty
# check version
json-db-api.cmd --version

Usage

// use longpollfetch("localhost:8080/test/note?longpoll=1")// use json patchfetch("localhost:8080/test/note?patch=1")// use bothfetch("localhost:8080/test/note?longpoll=1&patch=1")

Development

# Install dependencies
npm i
# link package
npm link
# run
json-db-api

ToDo

  • Specify database path
  • Long polling
  • JSON patch
  • Code splitting with fastify plugins
  • Tests
  • Nodemon
  • Eslint

About

Simple JSON API server inspired by jsonbase/myjson

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages