Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Latest commit

 

History

History

actix-cocktail-api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Flask Cocktail API

A simple API for getting cocktail recipes.

This code was written as part of a MongoDB Developer Hub blog post, it's not really designed to stand alone.

Run the code

You'll need to set the environment variable MONGO_URI to the URL of your MongoDB replicaset. I use direnv to configure this, and put the following line in my .envrc file in my project's directory:

export MONGO_URI="mongodb+srv://USERNAME:[email protected]/cocktails?retryWrites=true&w=majority"

You can then import the sample data with mongoimport:

mongoimport --uri "$MONGO_URI" --file ../data/recipes.json

And now you should be able to run the service like this:

cargo run