Skip to content

Commit

Permalink
fix: load favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
abelr20 committed Aug 22, 2024
1 parent e9aef79 commit 6f25d73
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
38 changes: 37 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"react-router-dom": "^6.23.1",
"recharts": "^2.12.7"
"recharts": "^2.12.7",
"serve-favicon": "^2.5.0"
},
"devDependencies": {
"@babel/core": "^7.24.5",
Expand All @@ -69,6 +70,7 @@
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@types/redux-mock-store": "^1.0.6",
"@types/serve-favicon": "^2.5.7",
"@types/testing-library__react": "^10.2.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
Expand Down
4 changes: 4 additions & 0 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dotenv/config';
import router from './routers/router.js';
import { fileURLToPath } from 'url';
import { ErrorHandler } from './utils/ErrorHandler.js';
import favicon from 'serve-favicon';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -15,6 +16,9 @@ const PORT = process.env.NODE_ENV === 'production' ? process.env.PROD_PORT : 808

app.use(cors());
app.use(express.json());

app.use(favicon(path.join(__dirname, '../../client/dist/favicon.ico')));

app.use(express.static(path.join(__dirname, '../../client/dist')));

app.use('/api', router);
Expand Down

0 comments on commit 6f25d73

Please sign in to comment.