GithubHelp home page GithubHelp logo

ariobramantyo / notes-app-backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 80 KB

This repository is intended as a Node.js backend exercise with the Hapi library

JavaScript 100.00%
api backend-api hapi-plugin nodejs notes

notes-app-backend's Introduction

Note APi Spec

Add Note

Endpoint : POST /notes

Request Body:

{
   "title": "Catatan A",
   "tags": ["Android", "Web"],
   "body": "Isi dari catatan A"
} 

Response Body (Success):

{
    "status": "success",
    "message": "Catatan berhasil ditambahkan",
    "data": {
        "noteId": "randomstring"
    }
}

Response Body (Failed):

{
    "status": "fail",
    "message": "\"body\" must be a string"
}

Get All Notes

Endpoint : GET /notes

Response Body (Success):

{
    "status": "success",
    "data": {
        "notes": [
            {
                "id": "randomstring",
                "title": "Catatan A",
                "body": "Isi dari catatan A",
                "tags": [
                    "Android",
                    "Web"
                ],
                "createdAt": "2023-10-02T12:20:39.106Z",
                "updatedAt": "2023-10-02T12:20:39.106Z"
            }
        ]
    }
}

Update Note

Endpoint : PUT /notes/{noteId}

Request Body:

{
    "title": "Catatan A Revised",
    "tags": ["Android", "Web"],
    "body": "Isi dari Catatan A Revised"
}

Response Body (Success):

{
    "status": "success",
    "message": "Catatan berhasil diubah"
}

Response Body (Failed):

{
    "status": "fail",
    "message": "\"body\" must be a string"
}

Delete Note

Endpoint : DELETE /notes/{noteId}

Response Body (Success):

{
    "status": "success",
    "message": "Catatan berhasil dihapus"
}

Response Body (Failed):

{
    "status": "fail",
    "message": "Catatan gagal dihapus. Id tidak ditemukan"
}

notes-app-backend's People

Contributors

ariobramantyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.