Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.97 KB

README.md

File metadata and controls

52 lines (32 loc) · 1.97 KB

[NOTICE] - DEPRECATED

This app is no longer under active development as of June 2022. As of July 2022, the OMSHub website project shall use Firebase moving forward as a "backend service" instead.

OMSHUB backend API (stub)

Go project using Gin router - https://github.com/gin-gonic/gin

Setup

VSCode fast-path

This project includes a .devcontainers configuration that can be used by VSCode to create a one-click development environment with Docker. The Docker container includes all of the dependencies you need to compile Go, forwards the port exposed by HTTP server to your local machine, and mounts the repository into the container so changes persist outside of Docker.

To get started:

  1. Install the Remote - Containers VSCode extension.
  2. Open the repository with VSCode. You should see a prompt on the bottom left of the screen to open the project inside the container.

Non-Docker/VSCode

  1. Install Go 1.18 and verify your installation by running go version.
  2. Install golangci-lint.
  3. Install Delve.
  4. Clone the repo.

Development

Run

  1. Run make build to produce the executable binary.
  2. Run ./core-api to start the server.

Test

  1. Run make test to execute Go tests.

Debug

  1. Run make debug to debug the server. You can alternatively use the debugging capabilities provided by your editor.

Directories

  • cmd/ - This is where the entrypoint into the application is (at api/main.go)
  • internal/ - This is where the routes of the server are defined. They are then imported into the main application in cmd/api/main.go

Currently there are only 2 routes defined, / and /ping.