marutha / webnesia

A REST interface to mnesia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webnesia

webnesia is a REST interface to Erlang's mnesia. It provides an API and a Web frontend with many similarities to CouchDB.

webnesia table UI

Installation instructions

  1. Make sure you have added rebar in $PATH

  2. Webnesia depends on mochiweb. To download dependencies rebar get-deps

  3. To compile rebar compile

  4. run ./start-dev.sh;

  5. open your browser on http://localhost:8000/_utils/.

API

Right now, these are the supported methods:

  • PUT /<table_name>: create a new table named table_name.

    The payload must contain the proposed table schema in the form of a JSON list of values. Example:

    ["id", "timestamp", "test_field"]

  • POST /<table_name>: insert a new record into the table name table_name or edit an existing record.

    The payload must contain the record data in the form of a JSON key-value pair list. Example:

    [{"id": 1, "timestamp": 1289145623708, "test_field": "the brown fox jumps over the lazy dog"}]

  • DELETE /<table_name>: delete the table named table_name.

  • DELETE /<table_name>/<record_id>: delete a specific record from the table table_name.

  • GET /<table_name>: read information about the table table_name.

  • GET /<table_name>/<record_id>: get a specific record from the table table_name.

  • GET /<table_name>/_all_records: read all records from table table_name.

    There are two optional parameters:

    • limit: limit the query to a given number of records;
    • skip: skip a given number of records.

About

A REST interface to mnesia


Languages

Language:JavaScript 52.4%Language:Erlang 46.9%Language:Shell 0.7%