"Express"way to the Back-End

Our API, written in Node and Express.

Get All Memes

GET https://mememachine2018.herokuapp.com/api/getAllMemes

This grabs random memes from multiple subreddits when the application is first loaded. It also assigns equal weights to all the subreddits so they are all likely to be used.

Request Body

Name
Type
Description

Nothing

boolean

No parameters required.

{
    result: [{
        image_url: "http...",
        subreddit: "programmerhumor"
    }],
    memeWeights: {
        memes: 50,
        ...
    }
}

Get Favorites

GET https://mememachine2018.herokuapp.com/api/getFavorites

Gets the user's favorite memes.

Request Body

Name
Type
Description

Nothing

boolean

No parameters required.

{
    result: [
        {
            image_url: "http...",
            id: "xyz...",
            date: "10/14/2018 Sun..."
        },
        ...
    ]
}

Update Memes

POST https://mememachine2018.herokuapp.com/api/updateMemes

Update meme weights and get new images.

Request Body

Name
Type
Description

memeWeights

object

The updated memeWeight values for each subreddit.

{
    result: [{
        image_url: "http...",
        subreddit: "programmerhumor"
    }],
    memeWeights: {
        memes: 50,
        ...
    }
}

Add Favorite

POST https://mememachine2018.herokuapp.com/api/addFavorite

Add an image URL to the user's list of favorites.

Request Body

Name
Type
Description

image

string

URL of the image to be saved as favorite.

{
    message: "ok"
}

Display Messenger Extension

GET https://vast-coast-38285.herokuapp.com/extension

Provides an extension interface for Facebook Messenger

Last updated