Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posts Router + GET /api/posts #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hallebot
Copy link
Member

closes #12

  • created posts router
  • used Posts.findAll model to send them back in response body

@hallebot hallebot requested a review from cainwatson May 24, 2019 20:44
@hallebot hallebot added this to In review in Example Big App via automation May 24, 2019
Copy link
Member

@cainwatson cainwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting this error when I make the request :(

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>Cannot GET /api/posts</pre>
    </body>
</html>


const Posts = require('../../db/Posts');

const posts = express.Router();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you rename this to

Suggested change
const posts = express.Router();
const postsRouter = express.Router();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Example Big App
  
In review
Development

Successfully merging this pull request may close these issues.

GET /api/posts endpoint
2 participants