diff --git a/api.js b/server/api.js similarity index 88% rename from api.js rename to server/api.js index 4473df8..27bcf30 100644 --- a/api.js +++ b/server/api.js @@ -63,6 +63,7 @@ app.get('/api/v1/rooms/:id', (req, res) => { }); // Create one room +<<<<<<< HEAD:api.js app.post('/api/v1/rooms', async (req, res) => { const { nome, cep, complemento, numero, emaildono } = req.body; @@ -83,6 +84,22 @@ app.post('/api/v1/rooms', async (req, res) => { console.error("Erro ao criar república:", err); res.status(500).json({ message: "Erro ao criar república" }); } +======= +app.post("/api/v1/rooms", async (req, res) => { + try { + + console.log(req.body); + res.status(201).json({ + status: "success", + data: { + room: "005" + } + }); + } catch (error) { + console.log(error) + } + +>>>>>>> 5c470814ba8467269c247d089103971758e6ef86:server/api.js }); diff --git a/src/index.js b/src/index.js index 154952f..8e19323 100644 --- a/src/index.js +++ b/src/index.js @@ -13,3 +13,8 @@ root.render( // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); + +const express = require('express'); +const server = express(); +const pool = require("./databasescripts/db"); + diff --git a/src/utils/cpf.js b/src/utils/cpf.js index fd0ec80..ba323fa 100644 --- a/src/utils/cpf.js +++ b/src/utils/cpf.js @@ -17,4 +17,6 @@ function verifyCpf(somecpf) { else { return false } -}; \ No newline at end of file +}; + +export default verifyCpf; \ No newline at end of file