8000 GitHub - addamb/Todo-api
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

addamb/Todo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo API

Todo API is a small todo api backend built in Go

Try live version

To create a new item

Use the endpoint using POST request

ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/create

Pass in json

{
	"name":"Buy bread"
}

To create get all items

Use the endpoint using GET request

ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/todos

To update an item

Use the endpoint using PUT request

ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/update

Pass in json

{
	"id": 1,
	"name": "Buy bread",
	"finished": true
}

To delete an item

Use the endpoint using DELETE request

ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/delete

Pass in json

{
	"ids": [1]
}

Locally

Migrations

Will need to run so we have a db to use

docker compose up postgresdb

install goose

go install github.com/pressly/goose/v3/cmd/goose@latest

or on mac

brew install goose

cd into migration folder

cd internal/repositories/db/migrations

Run:

 goose postgres "user=<user> password=<password> dbname=<db name> sslmode=disable" up

You can clone and run locally Just edit the .env file and make sure docker is installed and run

docker compose up

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0