This commit is contained in:
parent
4e49678250
commit
8bedda75d8
|
@ -13,31 +13,27 @@ import {
|
||||||
} from "./components";
|
} from "./components";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
const webApp = express();
|
export const webServer = express()
|
||||||
|
.use(express.static("static"))
|
||||||
webApp.use(express.static("static"));
|
.use(express.urlencoded({ extended: true }))
|
||||||
webApp.use(express.urlencoded({ extended: true }));
|
.get("/", (req, res) =>
|
||||||
|
res.send(
|
||||||
webApp.get("/", (req, res) =>
|
renderHtml(
|
||||||
res.send(
|
<Layout>
|
||||||
renderHtml(
|
<Form></Form>
|
||||||
<Layout>
|
</Layout>
|
||||||
<Form></Form>
|
)
|
||||||
</Layout>
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
.post("/", (req, res) => {
|
||||||
|
const inbox: Inbox = { name: req.body.name, token: newToken() };
|
||||||
webApp.post("/", (req, res) => {
|
fs.writeFileSync(feedPath(inbox.token), renderXml(Feed(inbox)));
|
||||||
const inbox: Inbox = { name: req.body.name, token: newToken() };
|
res.send(
|
||||||
fs.writeFileSync(feedPath(inbox.token), renderXml(Feed(inbox)));
|
renderHtml(
|
||||||
res.send(
|
<Layout>
|
||||||
renderHtml(
|
<Created inbox={inbox}></Created>
|
||||||
<Layout>
|
</Layout>
|
||||||
<Created inbox={inbox}></Created>
|
)
|
||||||
</Layout>
|
);
|
||||||
)
|
})
|
||||||
);
|
.listen(8443);
|
||||||
});
|
|
||||||
|
|
||||||
export const webServer = webApp.listen(8443);
|
|
||||||
|
|
Loading…
Reference in New Issue