Created
July 6, 2020 13:15
-
-
Save kianaditya/053a006f149bc8c3a91f007abbfb678a to your computer and use it in GitHub Desktop.
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
const queries = require('../models/queries') | |
const index = async (req, res) => { | |
const allPosts = await queries.getAllPosts() | |
res.status(200).send(allPosts) | |
} | |
const show = async (req, res) => { | |
const specificPost = await queries.getSpecificPost(req.params.id) | |
res.status(200).send(specificPost) | |
} | |
module.exports = { | |
index, | |
show, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment