ne-tam-simple-api
v1.0.1
Published
Simple API Server
Downloads
2
Readme
Simple API Server
run and fun
host$ simple-api-server -p 3002
open data dir ./data/root/data
creating data dir
open index
write
/^\/api\/data\/(.*)/
server started at localhost:3002
create and use collections
curl -X POST http://localhost/api/data/collection/test
curl http://localhost/api/data/crud/test/
{"error":0,"message":"Ok","result":[]}
#add first object
curl http://localhost/api/data/crud/test/first -d '{"i":1}'
{"error":0,"message":"Ok"}
#add second object
curl http://localhost/api/data/crud/test/second -d '{"i":2}'
{"error":0,"message":"Ok"}
curl http://localhost/api/data/crud/test/
{"error":0,"message":"Ok","result":[{"id":"first","author":"007","version":0,"links":[],"updated":1669895262897,"data":{"i":1}},{"id":"second","author":"007","version":1,"links":[],"updated":1669895272219,"data":{"i":2}}]}