Skip to content

Commit 1987263

Browse files
committed
public folder
1 parent 5e897bf commit 1987263

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

@app/client/src/pages/_document.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from "react";
2+
import Document, {
3+
Html,
4+
Head,
5+
Main,
6+
NextScript,
7+
DocumentContext,
8+
} from "next/document";
9+
10+
class MyDocument extends Document {
11+
static async getInitialProps(ctx: DocumentContext) {
12+
const initialProps = await Document.getInitialProps(ctx);
13+
return { ...initialProps };
14+
}
15+
16+
render() {
17+
return (
18+
<Html>
19+
<Head>
20+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
21+
</Head>
22+
<body>
23+
<Main />
24+
<NextScript />
25+
</body>
26+
</Html>
27+
);
28+
}
29+
}
30+
31+
export default MyDocument;

@app/server/public/favicon.ico

14.7 KB
Binary file not shown.

@app/server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async function main() {
5656
await middleware.installSession(app);
5757
await middleware.installPassport(app);
5858
await middleware.installLogging(app);
59-
// These are our assets: images/etc; served out of the /client/public folder
59+
// These are our assets: images/etc; served out of the /@app/server/public folder (if present)
6060
await middleware.installSharedStatic(app);
6161
if (isTest || isDev) {
6262
await middleware.installCypressServerCommand(app);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { static as staticMiddleware, Application } from "express";
22

33
export default (app: Application) => {
4-
app.use(staticMiddleware(`${__dirname}/../public`));
4+
app.use(staticMiddleware(`${__dirname}/../../public`));
55
};

0 commit comments

Comments
 (0)