Skip to content

Serverless API for (JSON) data storage. No hosting, no database!

Notifications You must be signed in to change notification settings

juanguren/Global-Array

Repository files navigation

Global Array

This project is a serverless API for (JSON) data storage. It is available to experimental, Proof of Concept, academic or hackathon-related projects as a realiable and easy to use storage solution. No hosting, no database.

Its purpose: Storing, updating, retrieving and also erasing JSON data on the go 🤷

Using Global Array:

There are two ways of accessing this API:

  1. Fork it on Serverless Cloud here. This way you'll have your own personal storage API, which can be scaled for you or your team as much as you like.
  2. Request an authentication token and start sending requests to the URLs (the process is explanied below).

  • Save/Update/Overwrite (POST): /data
  • Retrieve (GET): /data/:keyName
  • Delete (DELETE): /data/:keyName

Authentication Headers:


Saving, Updating and Overwriting Data

(POST Request: /data)

SEND

Make a request using the following JSON-parsed body structure:

{
    "content": {
      'your data goes in here..'
    },
    "instructions": {
        "keyName": "testKey"
    }
}

image

UPDATE DATA

Resending content using the same key name will append that body to the previously saved key, generating an update action.

OVERWRITE DATA

Using the same body, include the overwrite boolean attribute inside of "instructions. The overwrite should be sent on true

{
    "content": {
      "newData": "This should overwrite"
    },
    "instructions": {
        "keyName": "testKey",
        "overwrite": true
    }
}

Retrieving Data

(GET Request: /data/:keyName)

image

Check out an example

  • Use the following header for the example => [ api_key: test_token2465 ]

Deleting Data

(DELETE Request: /data/:keyName)


Special Modules:

  • Health check cron: A scheduler function running every 2 hours. Checks the status of the app.
  • Email Service (optional): If any error is identified on the network, an email may be sent as a "wake-up call". (current recipient: myself 😅)

About

Serverless API for (JSON) data storage. No hosting, no database!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published