Skip to content

mef79/impossibilicus-api

Repository files navigation

impossibilicus-api

This is the simplest possible API to interact with the UI in impossibilicus-web

Documentation of Libraries Used

  • Flask - minimal python web framework
  • Flask-RESTful - library that adds helpful REST conventions to Flask

Requirements

Starting the API

  • Start Mongo with mongod (if you're running Mongo locally, otherwise it just needs environment varibles set to reference the hosted DB)
  • From the project directory, create/activate a virtual environment (step-by-step instructions also in Flask's virtualenv docs)
  • Install the project dependencies with pip install -r requirements.txt
  • Environment variables that need to be set for the app to work: MONGODB_URI, MONGO_USERNAME (these live permanently in Heroku, I'm not committing them because even though this is private now, something something commit history)
    • Optionally, FLASK_DEBUG=1 to enable flask's debug mode, which will live update the app when changes are made and display more detailed error outputs
  • Start the API with python app.py
  • Confirm that it is running by accessing http://localhost:5000/
  • Use any REST client to make API calls (I use Insomnia)

Deploying

MongoDB Commands

  • Connect (requires Mongo installed): mongo ds147510.mlab.com:47510/database_name -u username -p password
  • Empty out a collection ("story"): db.story.remove({})

About

Back-end for an interactive editor for interactive fiction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published