Headless local note app with just-enough set of RESTful APIs
There are wide range of note apps out there, but the fundamental functionality is not so different among them. Programmers and desingers are kind of people who are good at creating whatever tools/UIs suitable for their own use case, and it has became substantially easier to create UI for multiple devices as variety of tools evolved in the past few years. This go gettable binary, called kaonashi, will get your back. You can create and keep polishing valuable note UIs for your own use case on top of RESTful APIs that should be just-enough for simple note app.
go get -u github.com/achiku/kaonashi/cmd/kaonashi
$ kaonashi -init
$ kaonashi -d &
Interacting with kaonashi using curl.
curl -v -H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"data":{"title":"my first note","body":"note body"}}' \
http://localhost:8080/note
{
"data": {
"message": "created"
}
}
curl -v -H "Accept: application/json" \
-H "Content-type: application/json" \
-X PUT \
-d '{"data":{"title":"my first note","body":"note body updated"}}' \
http://localhost:8080/note/1
{
"data": {
"message": "updated"
}
}
curl -v -H "Accept: application/json" \
-H "Content-type: application/json" \
-X DELETE \
http://localhost:8080/note/1
{
"data": {
"message": "deleted"
}
}
curl -v -H "Accept: application/json" \
-H "Content-type: application/json" \
-X GET \
http://localhost:8080/note
{
"data": [
{
"created": "2016-01-09 22:51:10.860726046 +0900 JST",
"id": 2,
"title": "title 02",
"updated": "2016-01-09 22:51:10.861432579 +0900 JST"
},
{
"created": "2016-01-09 22:20:45.814969118 +0900 JST",
"id": 1,
"title": "title 01",
"updated": "2016-01-09 22:20:45.816734399 +0900 JST"
}
]
}
curl -v -H "Accept: application/json" \
-H "Content-type: application/json" \
-X GET \
http://localhost:8080/note/2
{
"data": {
"body": "hello, kaonashi!",
"created": "2016-01-09 22:51:10.860726046 +0900 JST",
"id": 2,
"title": "title01",
"updated": "2016-01-09 22:51:10.861432579 +0900 JST"
}
}
Pull requests for new features, bug fixes, and suggestions are welcome!
This project is using gom for dependency management.
$ go get -u github.com/mattn/gom
$ gom install
$ go test -v
Using wbs, it will be really easy to code and reload.
$ cd cmd/kaonashi
$ gom exec wbs -c wbs.toml