celery/modules/08-echo.js
2024-07-28 06:37:14 -07:00

15 lines
443 B
JavaScript

const fs = require("fs");
const file = require("../static.js");
const { version } = require("./03-cache.js");
module.exports = (app, dir, log) => {
const gone = (req, res) => res.status(410).render("410.html", { cache: { style: version("/assets/style.css") } });
const redir = (to) => (req, res, next) => req.path === to ? next() : res.redirect(to);
app.get("/echo/*", (req, res) => {
res.json({
url: req.originalUrl,
});
});
};