Skip to content

Commit

Permalink
testing api stuff
Browse files Browse the repository at this point in the history
Must be done by tomorrow else im very dead, very dead.
  • Loading branch information
RA-Salles committed Aug 27, 2024
1 parent 23c7d3e commit 5c47081
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
17 changes: 9 additions & 8 deletions api.js → server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ app.get('/api/v1/rooms/:id', (req, res) => {
// Create one room
app.post("/api/v1/rooms", async (req, res) => {
try {

} catch (error) {
console.log(error)
}
console.log(req.body);
res.status(201).json({
status: "success",
data: {

console.log(req.body);
res.status(201).json({
status: "success",
data: {
room: "005"
}
});
} catch (error) {
console.log(error)
}

});

// Update one room
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

4 changes: 3 additions & 1 deletion src/utils/cpf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ function verifyCpf(somecpf) {
else {
return false
}
};
};

export default verifyCpf;

0 comments on commit 5c47081

Please sign in to comment.