Giter Site home page Giter Site logo

todo_api's Introduction

TODO List API (WIP)

This is still pretty much WIP, needs more tests (missing integration tests), fixing live tests (they work but will yield inconsistent results, becuase they live).

  • protobuf support
  • fix docker-compose for integration-test
  • fix migration for docker-compose (wait for postgres script)
  • add more API test (handler)
  • add more unit tests cases (error path)
  • cleanup makefile
  • fix lint issues
  • improve docs

Prerequisites

  1. Docker
  2. Postgres (for tests)
  3. Go 1.13+

Getting Started

If you just want to run it, I've created a docker-compose that will install everything for you and start the server.

To start, run:

make start

it will create everything you need and run it. the server is running on: localhost:4000 caveat: you will need to run migrations (actually rerun the migration container):

docker start migrate

to stop and cleanup:

make stop

in fact, this setup is running in development mode and if you want to devlop the container will refresh itself and compile the bin again. (caveat: sometimes issues with too many concurrent rebuilds and used port)

NOTE: make stop runs docker-compose down, and it will remove the postgres container. the setup is not meant to keep the data of this container. if you want to test "restarts" you can just restart todos container :)

Using the API

The easiest way would be importing the POSTMAN json file that describe the api. Otherwise the api is CRUD using REST:

(assuming you ran it using make start the host is http://localhost:4000)

GET /todos/?q=
GET /todos/:id
PUT /todos/:id {done: bool, name: string, details: string}
POST /todos {done: bool, name: string, details: string}
DELETE /todos/:id

Local Devlopment and Tests

if you want to devlop locally or run tests. start with

make install

Unit tests

make unit-tests

(Live test are ignored)

Integration tests

TODO

todo_api's People

Contributors

mrsufgi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.