Skip to content
flat file data store, Restful api, HTTP basic auth, Headless CMS Backend
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
.htaccess
LICENSE
README.md
config.php
index.php

README.md

Simple JSON Store

Author Source Code Software License

Simple PHP Json object store. You can use it as a simple flat file CMS or a Headless CMS Backend

Features

  • HTTP basic auth
  • Restful api
  • directory listing
  • filterable resource lists

contiguration

  • copy "config.php" to "config.loacal.php"
  • change admin password (defauld is "admin") or add new user

return [
    "user" => [
      "admin" => ["name" => "Administrator", "password" => "admin"]
    ],
];

Usage

create a resource

POST /list1/object1.json
{
  "name": "test",
  "hobbies": ["football", "tennis"]
}

create or override complete resource

PUT /list1/object1.json
{
  "name": "blub",
  "hobbies": ["football"]
}

update partial (resource must exists)

PATCH /list1/object1.json
{
  "name": "test"
}

Delete a resource

DELETE /list1/object1.json

Get a single resource

GET /list1/object1.json

Get a list of resources and sub directories

GET /list1

Response:

{
  "resources": ["object1.json"],
  "directories": ["some_sub_dir"]
}

Filter

  • equals
    • GET /list1?filter[0][field]=name&filter[0][op]=equal&filter[0][value]=test
  • string contains a part
    • GET /list1?filter[0][field]=name&filter[0][op]=contains&filter[0][value]=es
  • array contains value
    • GET /list1?filter[0][field]=hobbies&filter[0][op]=contains&filter[0][value]=tennis
You can’t perform that action at this time.