Skip to content

WayanBerdyanto/72210481_UTS

Repository files navigation

DESAIN ARSITEKTUR MICROSERVICES


Overview

This Example Minimal API uses sql (SqlServer) With the help of WEB ASP NET CORE, this REST API is an experiment in building a simple REST API. Later this API will be FETCHed with React JS

Setting Up Project

Clone the project into your local directory

git clone https://github.com/WayanBerdyanto/72210481_UTS.git

Install SQL SERVER you can install visit in SqlServer Download

See Documentation

dotnet watch run

Endpoint Documentation

Endpoint GetCategory

  • URL: https://localhost:5222/api/getAllCategory
  • Method: GET

Example Response

{
  "success": true,
  "message": "request update successful",
  "data": [
    {
      "categoryID": 1,
      "categoryName": "Food"
    },
    {
      "categoryID": 2,
      "categoryName": "Drink"
    }
  ]
}

Endpoint GetCategoryById

  • URL: https://localhost:5222/api/getCategoryById/{id}
  • Method: GET

Example Response

{
  "success": true,
  "message": "request data successful",
  "data": [
    {
      "categoryID": 1,
      "categoryName": "Food"
    }
  ]
}

Endpoint SearchNameCategory

  • URL: https://localhost:5222/api/getCategory/search/{categoryName}
  • Method: GET

Example Response

{
  "success": true,
  "message": "request successful",
  "data": [
    {
      "categoryID": 1,
      "categoryName": "Food"
    }
  ]
}

Endpoint InsertCategory

  • URL: https://localhost:5222/api/category
  • Method: POST

Example Input

{
  "categoryName": "Pizza"
}

Example Response

{
  "categoryID": 0,
  "categoryName": "Pizza"
}

Endpoint UpdateCategory

  • URL: https://localhost:5222/api/category
  • Method: PUT

Example Input

{
  "categoryID": 3,
  "categoryName": "Burger"
}

Example Response

{
  "success": true,
  "message": "request update successful",
  "data": {
    "categoryID": 3,
    "categoryName": "Burger"
  }
}

Endpoint DeleteCategory

  • URL: https://localhost:5222/api/category
  • Method: DELETE

Example Input

{
  "categoryID": 3,
}

Example Response

{
  "success": true,
  "message": "request delete successful"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages