updated dependecies, added context, axios config

This commit is contained in:
Ben Elferink
2021-03-13 17:46:51 +02:00
parent a895cc0647
commit bc37d68394
19 changed files with 39144 additions and 509 deletions

View File

@@ -0,0 +1,38 @@
import Account from '../models/Account.js';
// more about response status codes ---> https://restapitutorial.com/httpstatuscodes.html
export async function registerAccount(request, response, next) {
try {
// Handle your logic here...
// return something to the client-side
response.status(201).json({ message: 'Account registered' });
} catch (error) {
console.error(error);
response.status(500).send();
}
}
export async function loginAccount(request, response, next) {
try {
// Handle your logic here...
// return something to the client-side
response.status(200).json({ message: 'Account logged-in' });
} catch (error) {
console.error(error);
response.status(500).send();
}
}
export async function getAccount(request, response, next) {
try {
// Handle your logic here...
// return something to the client-side
response.status(200).json({ message: 'Account fetched' });
} catch (error) {
console.error(error);
response.status(500).send();
}
}