Hosted on Azure and Self Hosted
This project is an assignment for Microsoft Student Accelerator NZ 2020 Phase 2.
Pass the Story Backend for frontend.
Using Docker image to run golang on azure.
The following project uses:
- Golang
- gqlgen
- GORM
- SQL Server
- Docker
- Testing - go-sqlmock
Microsoft Student Accelerator 2020-Phase-2
- Install Golang
- git clone project
- setup .env file using template (connect to azure SQL server)
- Read
How to use
Golang Commands - go mod will auto install dependency
go run server.go
go build server.go
go test ./...
Docker Commands
docker build -t pts-backend .
docker run --publish <PORT>:<PORT> --name test --rm pts-backend
docker stop test
gqlgen Commans
gqlgen generate // run when change schema.graphql
Click to expand!
# Write your query or mutation here
query stories {
stories{
id
name
count
people
tags
createdAt
updatedAt
}
}
mutation createStory {
createStory(input: {
name: "Anonymous's 2000",
tags: "example, cool, love"
}){
id
name
tags
}
}
subscription subscriptionStory {
stories{
id
name
count
people
tags
createdAt
updatedAt
}
}
query Story {
story(id: 1) {
id
name
turns{
id
value
user{
id
}
}
count
people
tags
createdAt
updatedAt
}
}