Make API

An API for Exposing User Created Web Content

Welcome to the MakeAPI Docs!

The Make API is an API for exposing user created web content. It is developed by Mozilla and it's contributors and is mainly used by Mozilla Webmaker and it's tools: Popcorn Maker, Thimble and X-ray Goggles.

You can find the source code on Github

Installation

Dependencies

Setup

  1. Clone the git repository with git clone https://github.com/mozilla/MakeAPI.git
  2. Execute npm install in the application directory.
  3. In the root directory of the application, copy env.sample to a new file called .env
NOTE: The .env file contains settings for various aspects of the MakeAPI server's operation. The default settings should be enough for local development. For non-standard configurations, you may need to adjust where variables point to match the locations of your external dependancies. See the ENV file reference for more details.

Running

  1. Ensure all external dependencies are running
  2. Run node server.js from the root of the MakeAPI application
By default the server will run at http://localhost:5000. You can change this by adding PORT= to your .env file.
top

Configuration

Set/change these values in your .env file

Variable Name Description Default Value (none if empty)
SESSION_SECRET A secret string used to sign session cookies dummy secret value
COOKIE_DOMAIN The domain for the super cookie - leave unset for localhost development
PORT Port to accept incoming connections on 5000
NODE_ENV Indicates the environment the server is running in - possible values could be "development" or "production" development
MONGO_URL Connection string for the MongoDB instance mongodb://localhost/makeapi
ELASTIC_SEARCH_URL Connection String to ElasticSearch http://localhost:9200
AUDIENCE Persona Audience - typically set to the default, or the host and port of a local webmakerorg instance http://localhost:7777
LOGIN_SERVER URL for the Webmaker login server, for SSO on the admin page http://localhost:3000
LOGIN_SERVER_URL_WITH_AUTH Connection string for the webmaker login server, including basic auth credentials http://testuser:password@localhost:3000
FORCE_SSL Is this server running behind an SSL-enabled load-balancer? If so, set to true. false
USE_DEV_KEY_LOOKUP If true, the development API key lookup will be enabled. This means all hawk protected API calls will succeed if the private and public keys used are set to "00000000-0000-0000-000000000000". Turn this off if not in a development environment! true
ENABLE_GELF_LOGS Toggles on GELF formatted request logging via Messina false
ENFORCE_WRITE_PERMISSIONS If set to true, only the pair of API keys that created a make can be used to update/delete the make. This should be set to true in non-development environments false
AWS_ACCESS_KEY_ID AWS access key ID to be used by Hatchet /td>
AWS_SECRET_ACCESS_KEY AWS secret access key to be used by Hatchet ""
HATCHET_APP_NAME App name to be sent with Hatchet messages
HATCHET_QUEUE_REGION AWS Queue region that the SQS Queue resides in
HATCHET_QUEUE_URL AWS SQS Queue URL