This commit is contained in:
Leandro Facchinetti 2020-03-18 10:14:00 -04:00
parent 22874ecbd4
commit 8e0659a554
1 changed files with 7 additions and 5 deletions

View File

@ -4,16 +4,18 @@ import ReactDOMServer from "react-dom/server";
import { Layout, Form } from "./components"; import { Layout, Form } from "./components";
const app = express(); const app = express();
const doctype = `<!DOCTYPE html>\n`;
app.use(express.static("static")); app.use(express.static("static"));
app.get("/", (req, res) => app.get("/", (req, res) =>
res.send( res.send(
ReactDOMServer.renderToStaticMarkup( doctype +
<Layout> ReactDOMServer.renderToStaticMarkup(
<Form></Form> <Layout>
</Layout> <Form></Form>
) </Layout>
)
) )
); );