Skip to content

Commit 8fb8520

Browse files
fix: server fe folder
1 parent 728dd52 commit 8fb8520

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Other tools and technologies used:
1919
* [Bcrypt.js](https://github.com/dcodeIO/bcrypt.js): password encryption
2020

2121
## Prerequisites
22-
1. Install [Node.js](https://nodejs.org) and [MongoDB](https://www.mongodb.com)
22+
1. Install [Node.js](https://nodejs.org) and [MongoDB Community Edition](https://www.mongodb.com/try/download/community)
2323
2. Install Angular CLI: `npm i -g @angular/cli`
2424
3. From project root folder install all the dependencies: `npm i`
2525

server/app.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { join as pathJoin } from 'path';
66
import { connectToMongo } from './mongo';
77
import setRoutes from './routes';
88

9+
const feDir = 'public/browser';
910
const app = express();
1011
app.set('port', (process.env.PORT || 3000));
11-
app.use('/', express.static(pathJoin(__dirname, '../public')));
12+
app.use('/', express.static(pathJoin(__dirname, `../${feDir}`)));
1213
app.use(express.json());
1314
app.use(express.urlencoded({ extended: false }));
1415
if (process.env.NODE_ENV !== 'test') {
@@ -21,7 +22,7 @@ const main = async (): Promise<void> => {
2122
try {
2223
await connectToMongo();
2324
app.get('/*', (req, res) => {
24-
res.sendFile(pathJoin(__dirname, '../public/index.html'));
25+
res.sendFile(pathJoin(__dirname, `../${feDir}/index.html`));
2526
});
2627
app.listen(app.get('port'), () => console.log(`Angular Full Stack listening on port ${app.get('port')}`));
2728
} catch (err) {

0 commit comments

Comments
 (0)