Socket
Socket
Sign inDemoInstall

github.com/brianlusina/quote-api

Package Overview
Dependencies
50
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/brianlusina/quote-api


Version published

Readme

Source

Quote API

License Version Tests Lint Build Codacy Badge codecov Go

Simple API to fetch quotes and add quotes.

Requirements

A couple of things that you will need to set up the API up and running.

  1. Go

    You will need to install the Go 1.18 in order to run the application.

  2. Docker and Docker Compose

    You will need to install Docker & docker compose in order to run services the application uses.

Installation

Installation of dependencies can be done by running the following command:

make install

This install dependencies.

Running the application

Before running the application, first setup environment variables.

cp .env.sample .env

sets up environment variables from .env.sample file. Set these environment variables approprately. The db configuration settings have been set to reasonable defaults.

now run the services specified in docker-compose.yml file.

docker-compose up

Now we can run the application with the following command:

make run
# or
go run app/cmd/main.go

This will run the application on port 8080.

Testing the application

Testing the application can be done by running the following command:

make test

Runs the tests.

Running test coverage can be done with:

make test-coverage

Linting application

Applicationg linting can be done by first setting up golangci-lint:

make setup-linting

This installs the golangci-lint tool in the bin directory.

Now, linting can be run with the below command:

make lint

Runs linting.

Additionally, linting can be done on the Dockerfile with hadolint.

make lint-docker

This will run linting on the Dockerfile.

This uses Docker to run the linting.

FAQs

Last updated on 13 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc