import express from "express"; const WeatherUeuse = express.Router(); import { weatherNotice } from "../../scripts/weatherNotice.js"; WeatherUeuse.post("/actions/command-execute", (req, res) => { try { (async () => { await weatherNotice(); })(); res.status(202) .send("Accepted"); } catch(err) { res.status(500) .send(`Error: ${err}`); } }); WeatherUeuse.get("/actions/command-execute", (req, res) => { res.status(501) .send("POST Only"); }); export default WeatherUeuse;