Skip to content

Commit

Permalink
Another change on routes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiollende committed Mar 14, 2024
1 parent 5dfcc81 commit b191adb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ app.get('/health', (_req, res) => {
app.post('/login', async (req, res) => {
try {
// Forward the login request to the authentication service
const authResponse = await axios.post(authServiceUrl+'/login', req.body);
const authResponse = await axios.post(authServiceUrl + '/auth/login', req.body);
res.json(authResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand All @@ -35,7 +35,7 @@ app.post('/login', async (req, res) => {
app.post('/adduser', async (req, res) => {
try {
// Forward the add user request to the user service
const userResponse = await axios.post(userServiceUrl+'/adduser', req.body);
const userResponse = await axios.post(userServiceUrl + '/user/adduser', req.body);
res.json(userResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand All @@ -45,7 +45,7 @@ app.post('/adduser', async (req, res) => {
app.post('/edituser', async (req, res) => {
try {
// Forward the edit user request to the user service
const userResponse = await axios.post(userServiceUrl+'/edituser', req.body);
const userResponse = await axios.post(userServiceUrl + '/user/edituser', req.body);
res.json(userResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand Down
4 changes: 2 additions & 2 deletions users/userservice/user-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const User = require('./user-model')
// GET route to retrieve an specific user by username
// 'http://localhost:8002/getOneUser?username=nombre_de_usuario'

router.get('/getUser', async (req, res) => {
router.get('/getuser', async (req, res) => {
try {

// access to the database
Expand Down Expand Up @@ -76,7 +76,7 @@ router.post('/adduser', async (req, res) => {


// edit a user to update the total and correct question answered
router.post('/editUser', async (req, res) => {
router.post('/edituser', async (req, res) => {
try {

// --- find the user to be updated
Expand Down

0 comments on commit b191adb

Please sign in to comment.