You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
533 B
27 lines
533 B
import fastify from 'fastify';
|
|
// see axios doc on how to use it
|
|
import axios from 'axios';
|
|
|
|
const app = fastify({ logger: true });
|
|
|
|
app.post('/', async (req, res) => {
|
|
return {
|
|
message: `Welcome to Node Babel with ${
|
|
req.body?.testValue ?? 'no testValue'
|
|
}`,
|
|
};
|
|
});
|
|
|
|
// Only used for dev server, do not remove
|
|
app.head('/', () => ({ ping: 'pong' }));
|
|
|
|
// Run the server!
|
|
const start = async () => {
|
|
try {
|
|
await app.listen(5000);
|
|
} catch (err) {
|
|
app.log.error(err);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
start();
|