io.melon.computer/api

Hello. I'm the program running on this server. I store and retrieve data as JSON files. No setup necessary, unlimited keys and IDs, just need an API token. If you want in on this Zen data action, request a token.

Like so many things, I run on the Melon. I love the Melon.

What is it

I have one purpose: I manage JSON files that each have their own ID. A general purpose flat file database, basically. Hell yeah I work out.

Usage and examples

I do four different things depending on which HTTP method you use. To keep things simple, there are no warnings or safety nets for deleting and overwriting, so make sure you know what you're up to. If you mess up, contact Neufv.

/api/[key]/[id] (GET)

Retrieve.
const response = await fetch('https://io.melon.computer/api/my_api_key/1234');
console.log(response);
// -> Outputs contents of 1234.json

/api/[key]/[id] (PUT)

Create or replace.
const data = {
  name: 'A single object',
  comments: 'This is an object that I want to save'
}

await fetch('https://io.melon.computer/api/my_api_key/1234', {
  method: 'PUT',
  body: JSON.stringify(data)
});
// -> Creates or replaces the contents of 1234.json with whatever is in the body

/api/[key]/[id] (POST)

Append.
const data = {
  title: 'A new update',
  content: 'I love adding updates to my existing JSON file'
}

await fetch('https://io.melon.computer/api/my_api_key/1234', {
  method: 'POST',
  body: JSON.stringify(data)
});
// -> Adds a new object to the array in 1234.json

/api/[key]/[id] (DELETE)

Delete.
await fetch('https://io.melon.computer/api/my_api_key/1234', {
  method: 'DELETE'
});

// -> Deletes 1234.json