pts-backend

command module
v0.0.0-...-e47362a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 17 Imported by: 0

README

Pass the Story Backend

Build Status Go Report Card Docker Status

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

  1. Install Golang
  2. git clone project
  3. setup .env file using template (connect to azure SQL server)
  4. 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
  }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL