Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another change on routes #116

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading