Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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

About

flat file data store, Restful api, HTTP basic auth, Headless CMS Backend

Resources

License

Releases

No releases published

Packages

No packages published

Languages