---
# System prepended metadata

title: API TEST

---

# API TEST

**nome**     KEVIN RIBEIRO DE ANDRADE
**NUMERO** 27
**TURMA** INFO A


## JS

```javascript=
const express = require('express')
const server = express();

const cors = require('cors');
server.use(cors());

server.use(express.json())


let alunos = []


server.get('/', (req, resp) => {
    resp.send(alunos);
})


server.post('/', (req, resp) => {
    let aluno = req.body;
    alunos.push(aluno);
    resp.end()
})

server.put('/:pos', (req, resp) => {
    let aluno = alunos[req.params.pos];
    aluno.nome = req.body.nome;
    resp.end()
})

server.delete('/:pos', (req, resp) => {
    alunos.splice(req.params.pos, 1);
    resp.end();
})



server.listen(
    process.env.PORT, 
    () => console.log("o servidor subiu meu camarada")
)
```

## IMG

![](https://i.imgur.com/uWKYrYa.png)
![](https://i.imgur.com/OqgMpIr.png)
