Skip to content

Commit

Permalink
Segundo microserviço (Gerenciamento de Compromissos)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisgmunhoz committed Jun 2, 2023
1 parent f60c088 commit f536cc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion calendar/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ app.use(express.json());

// Configuração do client de conexões com o PostgreSQL
import client from './configs/database';
client.connect();

// Rota para obter os compromissos de um usuário
app.get('/user/:userId/appointments', async (req: Request, res: Response) => {
Expand All @@ -14,7 +15,7 @@ app.get('/user/:userId/appointments', async (req: Request, res: Response) => {
const query = 'SELECT id, title, date FROM appointments WHERE user_id = $1';
const values = [userId];
const result = await client.query(query, values);

const appointments = result.rows;

res.json(appointments);
Expand Down

1 comment on commit f536cc4

@vercel
Copy link

@vercel vercel bot commented on f536cc4 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mauagendar – ./

mauagendar-git-main-mauagendar.vercel.app
mauagendar.vercel.app
mauagendar-mauagendar.vercel.app

Please sign in to comment.