Skip to content

hackathon-22-digicon-team4/comiQ-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comiQ-server

Specification

specification

Prerequisites

1. Setup database

$ docker run -d -p 3306:3306 --env MYSQL_ROOT_PASSWORD=root mysql:8.0
$ mysql -P3306 -uroot -proot --protocol=tcp

# in MySQL repl
$ CREATE DATABASE comiq_dev;
$ exit

# in terminal
$ make db-migrate

2. Insert Fixtures

make seed

3. Start server & call api

  1. Start server
go run ./cmd/server
  1. Create New Session
$ curl -XPOST -H 'Content-Type:application/json' -d '{"id": "user1", "password": "password"}' --dump-header - localhost:50001/v1/users/login

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Set-Cookie: <session cookie>
Vary: Origin
Date: Sat, 24 Sep 2022 22:48:07 GMT
Content-Length: 20
  1. Call API
$ curl -H "cookie: <session cookie>" localhost:50001/v1/users/me

{"id":"user1"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published