Skip to content
Programming Quotes API for open source projects.
JavaScript
Branch: master
Clone or download
Latest commit 171a144 Jul 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backup remove duplicate Jun 16, 2019
config update host Jun 17, 2019
models required or Jul 15, 2019
routes fix votes Jun 18, 2019
utils add find user Jun 17, 2019
.eslintrc check admin role Mar 19, 2018
.gitignore add models Mar 12, 2018
Procfile add procfile Nov 2, 2017
README.md Update README.md Jun 29, 2019
index.js move passport to utils Jun 16, 2019
package-lock.json npm update Jul 15, 2019
package.json implement unique votes Jun 17, 2019

README.md

Programming Quotes API

Programming Quotes API for open source projects. You are welcome to contribute!

Homepage: programming-quotes-api.herokuapp.com

Github repo: github.com/skolakoda/programming-quotes-api

Client app: skolakoda.org/programming-quotes

API Documentation

Suported languages: en, sr.

{
  "en": "Computer Science is no more about computers than astronomy is about telescopes.",
  "sr": "Računarska nauka se tiče računara koliko i astronomija teleskopa.",
  "author": "Edsger W. Dijkstra",
}

Get all quotes

GET /quotes

Get quotes by language

GET /quotes/lang/en

Get quotes by page

GET /quotes/page/2

Get random quote

GET /quotes/random

Get random quote by language

GET /quotes/random/lang/sr

Get quote by id

GET /quotes/id/5a6ce86f2af929789500e824

Post vote

POST /quotes/vote

  • required params: quoteId, newVote (number from 1 to 5)

Post quote (user)

POST /quotes

  • required params: token, author, en
  • optional: source, sr
  • author name should be from Wikipedia

Update quote (admin)

PUT /quotes

  • required params: token, _id, author, en
  • optional: source, sr

Delete quote (admin)

DELETE: /quotes

  • required params: token, _id

Authentication

User login

GET /auth/{provider}

  • suported providers: Github, Google
  • opens login page

After successful login, user will be redirected to client app. The client app should handle token on this route: #/auth/{provider}/${token}.

Get user data

GET /auth/{provider}:token

  • returns info on current user

Development

Prerequisites

Start

npm i
npm run dev

Deploy

Deploy will be done automatically after merge into master branch.

You can’t perform that action at this time.