Programming Quotes API for open source projects.
Visit: programming-quotes-api.azurewebsites.net
Github repo: github.com/mudroljub/programming-quotes-api
Feel free to get involved, suggest or implement new features.
/api/quotes/random
/api/quotes?author=Edsger_W._Dijkstra
/api/quotes?page=1"esPerPage=20
/api/quotes
page
: The page number (default: 1). quotesPerPage
: Number of quotes per page (default: 20). author
: Filter quotes by a specific author./api/quotes/:id
Access to these routes requires a valid token.
/api/quotes
author
: The name of the author (should match a Wikipedia entry). text
: The quote text.source
: The source or context of the quote./api/quotes/:id
author
, text
, or source
./api/quotes/vote
quoteId
: The ID of the quote. newVote
: A numeric value (1–5)./api/quotes/:id
/api/auth/token
email
: The user's email address. password
: The user's password.Token Usage: For all subsequent requests, include the token in the Authorization
header as follows:
Authorization: Bearer <token>
Import json file into local MongoDB database (replace with real values):
mongoimport --db quotes --collection quotes --file quotes.json --jsonArray --username quotes --password quotes
Create .env
file proper values:
# database credentials (obtain from MongoDB)
CONNECTION_STRING=
# whatever random string you like
JWT_SECRET=
# use development for local testing
NODE_ENV=development
npm i
npm run dev