Using this as boilerplate: https://github.com/nixsolutions/golang-gin-boilerplate
- Create migration:
make create-migration name=${name}
- Run migrations:
make run-migrations
- Create db container using docker:
make create-docker-db
interface ChatMessage {
author: string;
content: string;
}
interface PlaylistItem {
id: number;
name: string;
url: string;
}
export interface Room {
id: string;
name: string;
userCount: number;
videoUrl: string;
messages: ChatMessage[];
playing: boolean;
progress: number;
playlist: PlaylistItem[];
}
- GET
/rooms
- params:
null
- response:
{ rooms: []Room }
- params:
- POST
/room
- params:
{ name: string; videoUrl?: string }
- response:
{ room: Room }
- params:
- GET
/room/{id}
- response:
{ room: Room }
or404
if not found
- response: