Skip to content

leohonlmc/go_api_microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API Microservices

Go Bear Logo Project Overview
`go_api_microservices` is a project developed in Go, utilizing Gin for handling routing and MongoDB for storing data. It offers API endpoints that allow data retrieval from the inventories and news collections. The data provided by these endpoints consist of simulated information about inventories from local food banks in Canada and news feeds.

Features

  • RESTful API endpoints to interact with MongoDB.
  • Utilizes Gin web framework for routing.
  • MongoDB integration using Go driver.
  • Clean and structured codebase.

Getting Started

Prerequisites

  • Go (1.x or later)
  • MongoDB
  • Git

Installation

  1. Clone the Repository

  2. Set Up MongoDB

  • Ensure MongoDB is running.
  • Use the inventories and news collections.
  1. Configure Environment Variables Create a .env file in the root with your MongoDB URI:

  2. Run the Application

Usage

API Endpoints

  • Get Inventories: GET /inventories

    • Fetches documents from the inventories collection.
    • Supports optional query parameters location and category for filtering.
  • Get News: GET /news

    • Retrieves documents from the news collection.

Example Requests

Contributing

Contributions are welcome. To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create a new Pull Request.

Releases

No releases published

Packages

No packages published