feat: start surfing page
This commit is contained in:
parent
d9fd968792
commit
c614e51708
@ -6,7 +6,8 @@ import fastifyView from "@fastify/view";
|
||||
import ejs from "ejs";
|
||||
|
||||
import mainRoute from "./routes/main-route";
|
||||
import parseRoute from "./routes/parseRoute";
|
||||
import parseRoute from "./routes/parse-route";
|
||||
import startRoute from "./routes/start-route";
|
||||
|
||||
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);
|
||||
|
7
src/routes/start-route.ts
Normal file
7
src/routes/start-route.ts
Normal file
@ -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");
|
||||
});
|
||||
}
|
39
templates/start.ejs
Normal file
39
templates/start.ejs
Normal file
@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>TXTDot starting page</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="/">
|
||||
<label for="url">URL</label>
|
||||
<input type="text" name="url">
|
||||
<p>
|
||||
<label for="engine">Engine</label>
|
||||
<select name="engine">
|
||||
<option selected value>Standard</option>
|
||||
<option value="readability">Readability</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="format">Format</label>
|
||||
<select name="format">
|
||||
<option selected value>Standard</option>
|
||||
<option value="html">HTML</option>
|
||||
<option value="text">Text</option>
|
||||
</select>
|
||||
</p>
|
||||
<input type="submit">
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user