Package: fast-json-server
fast-json-server v0.0.1fast-json-serverprovides a fullREST API / GraphQLServer with zero
coding in few seconds.fast-json-server provides a simple and quick back-end for development.fast-json-server only requires json data.Installation$pipinstallfast-json-serverHow to useCreate individual json files with some data in a folderNote:json objects must containidkey./sample_data/users.json[{"id":1,"first_name":"Sampath","last_name":"Varma"},{"id":2,"first_name":"Virat","last_name":"Ranbhor"},{"id":3,"first_name":"Rakesh","last_name":"Chopra"}]/sample_data/articles.json[{"id":1,"title":"Article1","content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore, et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","likes":20,"created_date":"11/30/2021","author_id":3},{"id":2,"title":"Article2","content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","likes":20,"created_date":"11/30/2021","author_id":2},{"id":3,"title":"Article3","content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","likes":20,"created_date":"11/30/2021","author_id":2}]Start Fast-JSON-Serverfast-json-server supports REST API and GraphQLpython-mfast_json_server.json_server--data_path="/sample_data"--host="0.0.0.0"--port=3000--log_level="debug"--server_type="rest_api"# orpython-mfast_json_server.json_server--data_path="/sample_data"--host="0.0.0.0"--port=3001--log_level="debug"--server_type="graph_ql"orfromfast_json_server.json_serverimportstart_serverstart_server(data_path="/sample_data",host="0.0.0.0",port=3000,log_level='debug',server_type="rest_api")# orstart_server(data_path="/sample_data",host="0.0.0.0",port=3000,log_level='debug',server_type="graph_ql")REST API Serverfast-json-server creates GET,POST,PUT,DELETE Routes from json files content.User routesGET    /api/v1/users?page_num=1&page_size=5
GET    /api/v1/users?id=&first_name=&last_name=
POST   /users
PUT    /users/1
DELETE /users/1Article routesGET    /api/v1/articles?page_num=1&page_size=5
GET    /api/v1/articles?id=&title=&content=&likes&author_id=
POST   /articles
PUT    /articles/1
DELETE /articles/1Example GET Requestcurl--location--requestGET'http://localhost:3000/api/v1/users?page_num=1&page_size=5'Example GET Response{"total_pages":1,"total_items":9,"page_data":{"page_num":1,"item_count":5,"items":[{"id":2,"first_name":"Sampath","last_name":"Varma"},{"id":3,"first_name":"Virat","last_name":"Ranbhor"},{"id":4,"first_name":"Rakesh","last_name":"Chopra"},{"id":5,"first_name":"Jimmy","last_name":"Kapoor"},{"id":6,"first_name":"Satya","last_name":"Ellapragada"}]}}fast-json-api provides interactive swagger api docs/api/v1/docsGraphQLfast-json-server creates the Query and Mutations from json files content.GraphQL endpoint/api/v1/graphqlUser Query# User data pagination{users(pageSize:3,pageNum:1){totalPages,totalItems,pageData{pageNum,itemCount,items{firstName,lastName}},}}# User data with filter{users(pageSize:3,pageNum:1,firstName:"Virat"){totalPages,totalItems,pageData{pageNum,itemCount,items{firstName,lastName}},}}User Mutations# create a recordmutation{createUsers(createRecord:{firstName:"Mohan",lastName:"Kumar"}){messageid}}# update a recordmutation{updateUsers(id:10,updateRecord:{firstName:"Mohan",lastName:"Chandra"}){message}}# delete a recordmutation{deleteUsers(id:10){message}}Article Query# Articles data pagination{articles(pageSize:3,pageNum:1){totalPages,totalItems,pageData{pageNum,itemCount,items{firstName,lastName}},}}# Articles data with filter{articles(pageSize:3,pageNum:1,title:"Article3"){totalPages,totalItems,pageData{pageNum,itemCount,items{title,contentlikes}},}}Article Mutations# create a recordmutation{createArticles(createRecord:{title:"Article10",content:"Kumar","likes":0,"author_id":1}){messageid}}# update a recordmutation{updateArticles(id:10,updateRecord:{title:"Article10",content:"Kumar","likes":0,"author_id":1}){message}}# delete a recordmutation{deleteArticles(id:10){message}}Note: All the data changes will be automatically saved to the json files.LicenseMIT