Skip to content

jcordoba95/lp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages