Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
/ jsonstore Public archive

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

License

Notifications You must be signed in to change notification settings

falkmueller/jsonstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages