项目作者: SanjayDevTech

项目描述 :
JSON fake placeholder api
高级语言: JavaScript
项目地址: git://github.com/SanjayDevTech/json-placeholder-server.git
创建时间: 2020-12-28T15:41:46Z
项目社区:https://github.com/SanjayDevTech/json-placeholder-server

开源协议:

下载


json-placeholder-server

Features

  • Own database
  • Highly customizable

Data preparation

  • Plan your data
  • Specify your rule in db-rules.js
  • Place the data in db.js

Configuration

  • Edit config.js for fallback port and flag to show status code in response.
  • Edit db-rules.js for rules.
  • Edit db.js for your data.
  • Run test.js to verify your data with rules.

Data I have added

  • Three collections
    • Posts
    • Foods
    • Users
  • Each document in a collection has a document id. It can be mentioned in db-rules.js.
    • Posts (id)
    • Foods (id)
    • Users (user_id)

API

  • {domain}/
    • Will list all data
  • {domain}/{collection_name}/
    • List all data inside a collection
  • {domain}/{collection_name}/{document_id}
    • List the matched document with document id