# 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  
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up