Coder Social home page Coder Social logo

tacofancy-api's Introduction

TacoFancy API

Making an API for https://github.com/sinker/tacofancy

Main endpoint

The main endpoint for the API exists at:

http://taco-randomizer.herokuapp.com/

Visiting that page will also get you a random taco.

Use this data

If you’d like to take advantage of the API that was put together for this, I added a CORS header to these paths so that you can load them from a javascript app anywhere on the internet.

Random Taco

Visiting:

/random/

will get you a random Base Layer, Mixin, Condiment, Seasoning and Shell. To just get a random full taco recipe, call it thusly:

/random/?full-taco=true

Contributors

If you’d like to get info about the contributors for a certain recipe, you can call this endpoint:

/contributors/:recipe_type/:recipe_slug/

So to get the contributors for the Delengua (Beef Tounge) Base Layer, do this:

/contributors/base_layers/delengua_beef_tongue

Valid layer types are: base_layers, mixins, seasonings, condiments and shells. To get a mapping of slugs for a given recipe type call this:

/contributors/:recipe_type/

Contributions

If you’d like to see who has made what contributions to which recipes, call this:

/contributions/:github_username/

So, to get all of Dan Sinker’s contributions, call this:

/contributions/sinker/

To get a listing of all contributors and their usernames, call:

/contributions/

Want to help?

This whole this is a relatively rudimentary Flask setup. After you pip install the requirements, you should be able to visit /cook/ to get a DB together. The Flask app is looking for an environmental variable DATABASE_URL to tell it how to connect to the database. Depending on what backend you’re using, you might need to actually create the database, etc before it’ll work. I developed this with sqlite but you should be able to use any backend that SQLAlchemy supports.

You’ll also need to set GITHUB_TOKEN as an environment variable. This is a OAuth Token for the Github API. You can read more about how to get that going here

tacofancy-api's People

Contributors

dansinker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.