diff --git a/package.json b/package.json index 181225d..18433e0 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc", - "dev": "ts-node src/app.ts", + "start-ts": "ts-node src/app.ts", "start": "node dist/app.js", - "watch": "tsc-watch --onSuccess \"node dist/app.js\"" + "dev": "tsc-watch --onSuccess \"node dist/app.js\"" }, "keywords": [], "authors": [ diff --git a/src/app.ts b/src/app.ts index 4fc6c80..38226d2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -5,8 +5,9 @@ import Fastify from "fastify"; import fastifyView from "@fastify/view"; import ejs from "ejs"; -import mainRoute from "./routes/main-route"; -import parseRoute from "./routes/parseRoute"; +import mainRoute from "./routes/main"; +import parseRoute from "./routes/parse"; +import startRoute from "./routes/start"; class App { config: IConfigService; @@ -28,6 +29,7 @@ class App { fastify.register(mainRoute); fastify.register(parseRoute); + fastify.register(startRoute); fastify.listen({ port: Number(this.config.get("PORT")) }, (err) => { err && console.log(err); diff --git a/src/routes/main-route.ts b/src/routes/main.ts similarity index 100% rename from src/routes/main-route.ts rename to src/routes/main.ts diff --git a/src/routes/parseRoute.ts b/src/routes/parse.ts similarity index 100% rename from src/routes/parseRoute.ts rename to src/routes/parse.ts diff --git a/src/routes/start.ts b/src/routes/start.ts new file mode 100644 index 0000000..06fc883 --- /dev/null +++ b/src/routes/start.ts @@ -0,0 +1,7 @@ +import { FastifyInstance } from "fastify"; + +export default async function parseRoute(fastify: FastifyInstance) { + fastify.get("/start", async (_, reply) => { + return reply.view("/templates/start.ejs"); + }); +} diff --git a/templates/start.ejs b/templates/start.ejs new file mode 100644 index 0000000..cfe0ee9 --- /dev/null +++ b/templates/start.ejs @@ -0,0 +1,35 @@ + + + + + + + TXTDot starting page + + + + + +
+ + +

+ + +

+

+ + +

+ +
+ + + \ No newline at end of file