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