Browse Source

add post route

master
Rich Brown 1 year ago
parent
commit
79719ad557
2 changed files with 7 additions and 0 deletions
  1. +2
    -0
      src/index.js
  2. +5
    -0
      src/router.js

+ 2
- 0
src/index.js View File

@@ -4,6 +4,8 @@ import router from './router';
const app = express();
const port = process.env.PORT || 3123;

// app.use(express.urlencoded({ extended: false }));
// app.use(express.json());
app.use(router);

app.listen(port, () => console.log(`on ${port}`)) // eslint-disable-line

+ 5
- 0
src/router.js View File

@@ -8,4 +8,9 @@ router.get('/', (req, res) => {
});
});

router.post('/', (req, res) => {
res.json({
queryParamsReceivedByServer: req.query || null,
});
});
export default router;

Loading…
Cancel
Save