21 lines
399 B
JavaScript
21 lines
399 B
JavaScript
// Declare a route
|
|
module.exports = function (fastify, opts, done) {
|
|
|
|
const pb = opts.pb;
|
|
|
|
fastify.post('/create-strategy', async (request, reply) => {
|
|
const data = request.body;
|
|
let output;
|
|
|
|
try {
|
|
output = await pb.collection("stockscreener").create(data)
|
|
}
|
|
catch(e) {
|
|
output = {};
|
|
}
|
|
|
|
reply.send({ items: output })
|
|
});
|
|
|
|
done();
|
|
}; |