Skip to content

adenflorian/random.dog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fb92469 · Sep 9, 2021

History

97 Commits
Jul 12, 2019
Sep 9, 2021
Nov 12, 2019
Sep 9, 2021
May 11, 2018
Nov 18, 2017
Nov 19, 2017
Nov 12, 2019
Mar 24, 2018
Feb 14, 2019
Jul 12, 2019
Dec 3, 2017
Apr 28, 2017
Sep 23, 2017
May 11, 2018
Jul 22, 2019
Feb 10, 2018
Sep 9, 2021
Jul 12, 2019

Repository files navigation

random.dog

Build Status

The nodejs code behind random.dog

Prerequisites

  • node@^10.1.0
  • yarn@^1.6.0

Setup

Tests

  • yarn test
  • yarn tdd

Security Setup

  • /review requires a cookie named bone
    • The value should be some base64 encoded text that, when hashed with bcrypt, matches the hash stored in a file named secret.json located in the project root folder
    • The json in secret.json should be like this:
      • {"secret": "<put hash here>"}
    • Use bcrypt-cli to hash the password to store in the secret.json
    • Example cookie header:
      • Cookie: bone=cGFzc3dvcmQ=

API

On the GET /woof, GET /woof.json, and GET /doggos endpoints, you may add a query parameter called filter which should have 1 or more file extensions, separated by commas. When hitting any of the above 3 endpoints with the filter param, that endpoint will only return dogs that do not have one of the filtered extensions. There is also an include query param that does the opposite of filter.

Example: GET random.dog/woof?filter=mp4,webm will only return dogs that do not have an extension of mp4 or webm.

Example: GET random.dog/woof?include=mp4,webm will only return dogs that do have an extension of mp4 or webm.