You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
736 B
20 lines
736 B
import { Req, Res, ReturnValue } from "#/global"
|
|
import { LoginUserSchema, RegisterUserSchema, UserSchema } from "@/schema"
|
|
import { baseDir, gFail, gSuccess } from "@/util"
|
|
import { auth, config, method, route, validate } from "@noderun/hapi-router"
|
|
import * as bcrypt from "bcrypt"
|
|
import path from "path"
|
|
import fs from "fs-extra"
|
|
|
|
export default class {
|
|
@route("/path/{path*}")
|
|
async all(req: Req, h: Res): ReturnValue {
|
|
if (req.params && req.params.path) {
|
|
const filePath = path.resolve(baseDir, "template/htmx/path", req.params.path+".pug")
|
|
if(fs.existsSync(filePath)){
|
|
return h.view(`htmx/path/${req.params.path}.pug`)
|
|
}
|
|
}
|
|
return "404"
|
|
}
|
|
}
|
|
|