Skip to content

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
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

None yet

Development

Successfully merging this pull request may close these issues.

GET /api/posts endpoint

2 participants