- This repo is the server-side of our decoupled app.
- The client side is live on the web here: https://watclient-3b85b.firebaseapp.com/
- WAT is a Reddit clone geared toward providing resources for learning full-stack web development, with the MVP being focussed on JavaScript.
- Visitors can view all the learning resources (videos, websites, books, etc.).
- Registered users can Add resources, Comment on them, and add their favorites to a list.
- Andrew Vandermeer
- Andy Knolla
- Christopher Comella
- Steven Lawson
OAuth:
- /auth/github - Login user.
- /logout - Logout user.
API:
- Root route: api/v1
- Endpoints:
- /categories - Returns all categories.
- /resources - Returns all resources.
- /resources/:id - Returns a resource by its id.
- /resources/categories/:category - Returns all resources in a given category.
- A GitHub account
- PostgreSQL
- Node.js
- Create a new OAuth app on GitHub: https://github.com/settings/applications/new
- Enter these settings on the GitHub OAuth app settings page:
- Homepage URL: https://watserver.herokuapp.com
- Authorization callback URL: https://watclient-3b85b.firebaseapp.com
- Clone project and cd into project directory.
- Edit the .env file as per the .env.example file.
- Run these commands:
$ createdb wat
$ npm i
$ knex migrate:latest
$ knex seed:run
$ npm start
Then visit:
http://localhost:3000/api/v1/resources
[or any of the other API routes listed above]
https://watserver.herokuapp.com/api/v1/resources
[or any of the other API routes listed above]
$(document).ready(function() {
$.ajax({
url: "https://watserver.herokuapp.com/api/v1/resources/categories/javascript",
success: function(result) {
// Do whatever you want with the result here, such as:
for (var i = 0; i < result.resources.length; i++) {
console.log(result.resources[i])
}
}
});
});