Created
June 16, 2020 10:09
-
-
Save kianaditya/2e76bc1a13d5d29cf955e1437bed1324 to your computer and use it in GitHub Desktop.
medium express article two
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// controllers/posts.js | |
const db = require('../models') | |
exports.getAllPosts = async (req, res, next) => { | |
const allPosts = await db.Post.findAll({ | |
attributes: ['id', 'title', 'content'], | |
}) | |
res.status(200).send(allPosts) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment