A json-server fork to enjoy developing frontend apps without a real backend, but with JWT auth.
- Create a
db.jsonfile with the entities of your DB - Run the server with
npm start - Register a user with
POST /auth/register { username: "luke", password: "skywalker" } - Login to obtain your JWT token:
POST /auth/login { username: "luke", password: "skywalker" } - Start using
json-serverroutes in/api/<json-server routes>. You'll need to auth every request by adding an HTTP header:Authorization: Bearer <JWT token>
You can upload files by making a multipart POST request with a file field (with file contents) to /upload.