Skip to content

Commit

Permalink
Conserto da rota da bd
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielbgoncalves committed Sep 22, 2024
1 parent ff28f18 commit c225a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const corsOption = {
app.use(cors(corsOption));
app.use(express.json());

app.post('/api/ranking', async (req, res) => {
app.post('/ranking', async (req, res) => {
try {
let { nome, pontuacao, id } = req.body;

Expand All @@ -66,7 +66,7 @@ app.post('/api/ranking', async (req, res) => {
}
});

app.get('/api/ranking', async (req, res) => {
app.get('/ranking', async (req, res) => {
try {
const collection = db.collection('players-ranking');
const rankingOrdenado = await collection.find().sort({ pontuacao: -1 }).toArray();
Expand Down

0 comments on commit c225a32

Please sign in to comment.