Skip to content

Instantly share code, notes, and snippets.

@DotAmzi
Created February 21, 2024 17:18
Show Gist options
  • Save DotAmzi/a3ab63d02f1a15a5f66a818f5a80eeed to your computer and use it in GitHub Desktop.
Save DotAmzi/a3ab63d02f1a15a5f66a818f5a80eeed to your computer and use it in GitHub Desktop.
arquivo node test
const express = require('express');
const app = express();
const port = 3000;
app.use(express.json());
app.get('/', (req, res) => {
console.log('GET request received');
res.send('Hello GET!');
});
app.post('/', (req, res) => {
console.log('POST request received');
console.log(req.body);
res.send('Hello POST!');
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment