From 85efe8ffea1b67adcf7ffd5533bbe3be36c9be1c Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Mon, 22 Jul 2024 21:01:10 +0700 Subject: [PATCH] Create astroinformatics.js --- routes/astroinformatics.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 routes/astroinformatics.js diff --git a/routes/astroinformatics.js b/routes/astroinformatics.js new file mode 100644 index 0000000..43e8cdd --- /dev/null +++ b/routes/astroinformatics.js @@ -0,0 +1,25 @@ +import express from 'express'; +import * as Astropy from 'astropy'; + +const router = express.Router(); +const astropy = new Astropy.Astropy(); + +router.post('/astronomical-object-detection', async (req, res) => { + const { image } = req.body; + const detections = await astropy.detect(image); + res.json({ detections }); +}); + +router.post('/astronomical-object-characterization', async (req, res) => { + const { object } = req.body; + const characterization = await astropy.characterize(object); + res.json({ characterization }); +}); + +router.post('/astronomical-event-prediction', async (req, res) => { + const { data } = req.body; + const prediction = await astropy.predict(data); + res.json({ prediction }); +}); + +export default router;