Simple Notes

a simple RESTful API for crud database operation

πŸ›  Tech Stack

  • Go
  • MySQL
  • Gorillamux

πŸ“„ Reference

πŸ“Œ Endpoints

πŸ§β€β™‚οΈ USERS

/users/login - POST Login URL. Generate a Json Web Token. Example of request body:

{
  "username": "imamrizaldi",
  "password": "donggala"
}

/users - POST Create a new user. Example of request body:

{
  "username": "johndoe",
  "password": "janedoe"
}

/users - GET Fetch all users

✏ NOTES

All of notes endpoints will be needed a JSON WEB TOKEN Auth that generated from /login.

/notes - POST Create new note. Example of request body:

{
  "title": "Golang",
  "content" : "Tutorial Golang Dasar"
}

/notes - GET Fetch all notes

/notes/{id} - GET Get note by ID

/notes/{id} - PUT Update note. Example of request body:

{
  "title": "Golang",
  "content" : "Tutorial Golang MySQL"
}

/users/notes/{id} - DELETE Delete note


πŸ”œ Feature to Add:

  • JWT auth (doneβœ…)
  • Unit testing