add auth-service not verified with Dockerfile
This commit is contained in:
parent
3a7389ba68
commit
8cf6520224
12 changed files with 304 additions and 0 deletions
13
backend/service-authentication/message.js
Normal file
13
backend/service-authentication/message.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// renvoie un message au format JSON. On a besoin de passer en paramètre
|
||||
// res, la réponse que l'on envoie au client (Angular). Le paramètre
|
||||
// data est un objet JavaScript. Globalement, cette fonction est
|
||||
// équivalente au "echo json_encode(data);" que vous utilisiez en PHP
|
||||
function sendMessage (res, data) {
|
||||
res.json ({ status: 'ok', data: data });
|
||||
}
|
||||
|
||||
function sendError (res, reason) {
|
||||
res.json ({ status: 'error', data: {reason: reason }});
|
||||
}
|
||||
|
||||
module.exports = { sendMessage, sendError };
|
||||
Reference in a new issue