lp-server

command module
v0.0.0-...-5be1069 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 10 Imported by: 0

README

LP-Jcordoba95

Hello! Here is the project I built to learn and practice GoLang.

Project Description

LP-Jcordoba95 is an API for a Web platform that provides a simple calculator functionality (addition, subtraction, multiplication, division, square root, and a random string generation) where each functionality will have a separate cost per request.

User's will have a starting credit / balance. Each request will be deducted from the user's balance. If the user's balance isn't enough to cover the request cost, the request shall be denied.

Installation

MacOS Instalation
  1. Install Go from https://go.dev/dl/

  2. Download this repository and follow this instructions to set up your go workspace if you haven't done so yet. If you want to change your GOPATH to something else add GOPATH to your shell/bash/zsh initialization file .bash_profile, .bashrc or .zshrc.

export GOPATH=/something-else
  1. Add GOPATH/bin directory to your PATH environment variable so you can run Go programs anywhere.
export PATH=$PATH:$(go env GOPATH)/bin
  1. Make sure to re-source source .bash_profile your current session or simply open new terminal.

  2. Create a database to be used for this project. I used this free service .

Running the API

  1. Make a copy of env.example. and create your .env and fill out the variables.

  2. cd into the project folder and run:

CompileDaemon -command="./lp-server"

Testing

To run tests:

go test -v ./...

WIP/TODO:

  • Create test db with some initial data
  • Create E2E tests for records controller

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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