Last active
October 8, 2018 01:06
-
-
Save TaylorAckley/e68256ff92f4878972c138071e5a0c31 to your computer and use it in GitHub Desktop.
MVC - Controller
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 AccountStore = require('../stores/account.store'); | |
class AccountController { | |
static async register(req, res) { | |
try { | |
let payload = await AccountStore.register(req); | |
res.send(payload); | |
} catch(exception) { | |
res.status(500).send(exception) | |
} | |
} | |
static async getAll(req, res) { | |
try { | |
let payload = await AccountStore.getAllUsers(req); | |
res.send(payload); | |
} catch(exception) { | |
res.status(500).send(exception) | |
} | |
} | |
} | |
module.exports = AccountController; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment