go-api-example

module
v0.0.0-...-c447797 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0

README

Go API Example

This is a simple example of a RESTful API written in Go.

Getting Started

Prerequisites
  • Docker
  • Git
Installation
  1. Clone the repository:
    git clone https://github.com/yourusername/go-api-example.git
    
  2. Navigate to the project directory:
    cd go-api-example
    
  3. Set file permissions:
    sudo groupadd -g 1009 go-api
    sudo chgrp -R go-api ./
    sudo chmod g+w -R ./
    
  4. Install dependencies:
    docker compose up -d
    

The server will start on http://localhost:8080.

API Endpoints
  • GET /receipts/{id}/points - Retrieve the number of points earned for a receipt with the specified ID
  • POST /receipts/process - Create a new receipt and process points
License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

Acknowledgments

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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