RESTAPI Notes (CRUD) and Authentication Using ktor (Kotlin) and mySQL Database.
Runs embedded web server on localhost:8080 (baseurl).
GETAll Notes.
{baseurl}/notes
GETOne Note By ID.
{baseurl}/notes/{id}
POSTOne Note.
{baseurl}/notes
your json request
{
"note":"write your note"
}PUTNote By ID.
{baseurl}/notes/{id}
your json request
{
"note":"update your note"
}DELETENote By ID.
{baseurl}/notes/{id}
POSTLogin User.
{baseurl}/login
your json request
{
"userName":"mosamir",
"password":"1234567"
}POSTRegister User.
{baseurl}/register
your json request
{
"userName":"mosamir",
"password":"1234567"
}can use MySQL Workbench for create your database.
- Create Database.
create database notes;
- Select Database For Use.
USE notes;
- Create Notes Table.
create table note( id int not null auto_increment, note varchar(1500) not null, primary key(id) );
- Create Users Table.
create table users( id int not null auto_increment, userName varchar(100) not null, password varchar(100) not null, primary key(id) );