Skip to content

ufakz/delivery-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delivery-API

This is a simulated delivery API for the backend of a webstore that uses the Gokada.ng business API to generate estimates for orders and store order details in a Firebase Firestore cloud database.

Installation

Clone the repository and install dependencies from the root directory using

go install

API Documentation

The API has two endpoints:

  • /delivery_estimate which returns the estimate of a delivery order based on the distance between the source and destination addresses
  • /delivery_order which stores details of the order in the firestore database and returns the estimate of the delivery order

The API documentation is automatically generated using swagger. The documentation files are here. The automatically generated API spec file is here.

To generate the API spec yaml file, run the following command from the root directory:

swagger generate spec -o ./delivery.yaml --scan-models

To serve the documentation on a browser interface. Run the command:

swagger serve -F=swagger swagger.yaml

Testing

The API uses the standard go testing library. Currently only tests for the delivery order exists. To run the test, simply run the go test -v ./delivery command.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published