Moxie
An online REST API for prototyping.
Getting Started
Make a GET, POST, PUT, PATCH, or DELETE request to a moxie API endpoint.
GET https://moxie.vercel.app/api/@itsjonq/hello
Example
Below is an example JS request made with window.fetch
. Check out the sample response.
fetch('https://moxie.vercel.app/api/@itsjonq/samples/1')
.then(response => response.json())
.then(data => console.log(data));
URL Format
The format of the API endpoint:
https://moxie.vercel.app/api/:username/:collection/:id
Value | Required | Description |
:username | Yes | Your "username". Must start with a @ . |
:collection | Yes | The name of your collection of data. |
:id | The id of an single item. |
React Hooks
Check out the official React hooks library to get started with Moxie + React.
About Moxie
To keep things simple, Moxie does not require authentication.
Since we don't require logins, a "username" is just a convention to establish your personal playground.
We don't monitor or curate data. Please don't store anything sensitive or important. There's no guarantees that your data will be preserved.
After all, Moxie just for prototyping!
P.S. Please be nice and don't override other people's stuff 🙏
Endpoints
Here are some endpoints you can hit:
Collections
Collections are a list (Array) of data (entries). When making a POST
request, if a collection doesn't exist, Moxie will make one for you!
Example: https://moxie.vercel.app/api/@itsjonq/hello
Method | Body | Description |
GET | Gets a collection of data. | |
POST | { message: 'haiii' } | Adds a new entry to the collection. Multiple entries can be added with an array. |
PUT | [{ id: 'one', message: 'haiii' }] | Updates multiple entries. |
PATCH | [{ id: 'one', message: 'haiii' }] | Updates multiple entries. |
DELETE | [{ id: 'one' }] | Deletes entries from the collection. If no arguments are passed, this deletes the entire collection. |
id
and createdAt
fields are automatically generated for you on GET requests.
Entries
Entries are individual items within a Collection.
Example: https://moxie.vercel.app/api/@itsjonq/hello/123
Method | Body | Description |
GET | Gets an entry. | |
POST | { message: 'haiii' } | Adds a new entry. |
PUT | { message: 'haiii' } | Updates an existing entry. |
PATCH | { message: 'haiii' } | Updates an existing entry. |
DELETE | Deletes an entry. |
updatedAt
fields are automatically generated for you on PATCH/PUT requests.
Have Fun!
And that's Moxie! Have fun building cool things.
© 2024. Made with 🦄 by Q.