GithubHelp home page GithubHelp logo

crudgo's Introduction

crudGo

start

  • docker-compose
$ docker compose up -d
  • run server
$ docker exec -it crudgo_go_1 bash
# go run main.go
  • look mysql
docker exec -it crudgo_db_1 bash

endpoints

$ curl http://localhost:8080/api/v1/users | jq .
$ curl http://localhost:8080/api/v1/users/{user_id} | jq .
$ curl -X POST -H 'Content-Type:application/json' -d '{"name":"test_name", "self_introduction":"test_self_introduction", "email":"[email protected]", "password_digest":"test123", "address":"test_address", "phone_number":"00000000000"}' http://localhost:8080/api/v1/me/ | jq .

// login(get jwt)
$ curl http://localhost:8080/api/login -X POST -H 'Content-Type:application/json' -d '{"email":"[email protected]", "password":"test123"}'
// with jwt
$ curl http://localhost:8080/api/v1/me/
$ curl -X POST -H 'Content-Type:application/json' -d '{"name":"test_name", "self_introduction":"test_self_introduction", "email":"[email protected]", "password_digest":"test123", "address":"test_address", "phone_number":"00000000000"}' http://localhost:8080/api/v1/me/ | jq .
$ curl http://localhost:8080/api/v1/me/ -X DELETE
$ curl http://localhost:8080/api/v1/logout

test

go test ./test/controller/ -cover

crudgo's People

Contributors

kousuketk avatar

Watchers

 avatar

crudgo's Issues

issue

  • access log管理
  • testを書く

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.