Aggiunto collegamento al server
This commit is contained in:
34
plugin/routes/index.js
Normal file
34
plugin/routes/index.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const registerMapRoutes = require("./map");
|
||||
const registerHelmRoutes = require("./helm");
|
||||
const registerDatasetRoutes = require("./dataset");
|
||||
const registerForecastRoutes = require("./forecasts");
|
||||
const registerTelegramRoutes = require("./telegram");
|
||||
|
||||
/**
|
||||
* Registers all plugin routes under the /meb prefix.
|
||||
* @param {Object} app - SignalK app instance
|
||||
* @param {Object} settings - Plugin settings
|
||||
*/
|
||||
module.exports = function (app, settings) {
|
||||
const router = {
|
||||
get: (subPath, handler) => {
|
||||
const fullPath = '/meb' + (subPath.startsWith('/') ? subPath : `/${subPath}`);
|
||||
app.get(fullPath, handler);
|
||||
},
|
||||
post: (subPath, handler) => {
|
||||
const fullPath = '/meb' + (subPath.startsWith('/') ? subPath : `/${subPath}`);
|
||||
app.post(fullPath, handler);
|
||||
}
|
||||
};
|
||||
|
||||
// Health check
|
||||
router.get("/ping", (req, res) => {
|
||||
res.status(200).send("Ping is active!");
|
||||
});
|
||||
|
||||
registerMapRoutes(router, app, settings);
|
||||
registerHelmRoutes(router);
|
||||
registerDatasetRoutes(router, app);
|
||||
registerForecastRoutes(router, app);
|
||||
registerTelegramRoutes(router);
|
||||
};
|
||||
Reference in New Issue
Block a user