Skip to content

Add Events CRUD #41

Open
Open

Description

@fawcilize
  • Use express

  • CRUD for event management

    • Create: POST /v1/events

If I make a call to create an event at http://localhost:3000/v1/events, with the body:

JSON
{
  "name": "Cool Concert",
  "location": "At the concert hall"
}

then I would expect to get a response like:

JSON
{
  "id": 1,
  "name": "Cool Concert",
  "location": "At the concert hall"
}
  • Read: GET /v1/events, /v1/events/{:id}

If I make a call to get all events at http://localhost:3000/v1/events, then I would expect to get a response like:

JSON
{
  "events": [
    {
      "id": 1,
      "name": "Cool Concert",
      "location": "At the concert hall"
    },
    {
      "id": 2,
      "name": "Easter Egg Hunt",
      "location": "Bond Park"
    }
  ]
}

If I make a call to get a single event at http://localhost:3000/v1/event/1, then I would expect to get a response like:

JSON
{
  "id": 1,
  "name": "Cool Concert",
  "location": "At the concert hall"
}
  • Update: PUT /v1/events/{:id}

If I make a call to create an event at http://localhost:3000/v1/events/1, with the body:

JSON
{
  "id": 1,
  "name": "Super Cool Concert",
  "location": "At the concert hall"
}

then I would expect to get a response like:

JSON
{
  "id": 1,
  "name": "Super Cool Concert",
  "location": "At the concert hall"
}
  • Delete: DELETE /v1/events/{:id}

Activity

  1. changed the title [-]Create NodeJS Server[/-] [+]Add Events CRUD[/+] on Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions