Pass the Story Backend
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:
Microsoft Student Accelerator
2020-Phase-2
Setup
- Install Golang
- git clone project
- setup .env file using template (connect to azure SQL server)
- Read
How to use
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
Example Queries
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
}
}