Skip to content

Commit

Permalink
21/03/2023
Browse files Browse the repository at this point in the history
  • Loading branch information
conghieutk1 committed Apr 21, 2023
1 parent 57304ef commit b8c623a
Show file tree
Hide file tree
Showing 20 changed files with 552 additions and 59 deletions.
166 changes: 136 additions & 30 deletions package-lock.json

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

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"@formatjs/intl-pluralrules": "^3.5.6",
"@formatjs/intl-relativetimeformat": "^7.3.6",
"@fortawesome/fontawesome-free-webfonts": "^1.0.9",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"axios": "^0.21.1",
"babel-plugin-macros": "^3.1.0",
"bootstrap": "^5.0.1",
"connected-react-router": "^6.9.1",
"lodash": "^4.17.21",
Expand Down
32 changes: 19 additions & 13 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
const express = require('express');
const path = require('path');
const express = require("express");
const path = require("path");

const app = express();

const buildDir = path.join(__dirname, '../build');
console.log('Using files in ' + buildDir);
const buildDir = path.join(__dirname, "../build");
console.log("Using files in " + buildDir);

const subDir = '/';
const subDir = "/";
const logRequests = false;

if (subDir === '/') {
console.log('The server config assuming it is serving at the server root. You can control this with the `subDir` variable in index.js.');
if (subDir === "/") {
console.log(
"The server config assuming it is serving at the server root. You can control this with the `subDir` variable in index.js."
);
} else {
console.log('The server config assuming it is serving at \'' + subDir + '\'.');
console.log(
"The server config assuming it is serving at '" + subDir + "'."
);
}

if (logRequests) {
console.log('The server will log all incoming request. It\'s not recommended for production use.');
console.log(
"The server will log all incoming request. It's not recommended for production use."
);
}

// Serve the static files from the React app
app.use(subDir, express.static(buildDir));
// Handles any requests that don't match the ones above
app.get('*', (req, res) => {
app.get("*", (req, res) => {
if (logRequests) {
console.log(req.method + ' ' + req.url);
console.log(req.method + " " + req.url);
}
res.sendFile(path.join(buildDir, 'index.html'));
res.sendFile(path.join(buildDir, "index.html"));
});

const port = process.env.PORT || 3000;
app.listen(port);

console.log('React.JS App is running on the port ' + port);
console.log("React.JS App is running on the port " + port);
Binary file added src/assets/header-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/104635-khamnhakhoa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133537-khamchuyenkhoa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133657-khamtuxa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133744-dichvuxetnghiem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133744-khamtainha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133744-khamtongquat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/133744-suckhoetinhthan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/options/151930-phau-thuat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Route, Switch } from "react-router-dom";
import { ConnectedRouter as Router } from "connected-react-router";
import { history } from "../redux";
import { ToastContainer } from "react-toastify";

import {
userIsAuthenticated,
userIsNotAuthenticated,
Expand All @@ -19,7 +18,7 @@ import Header from "./Header/Header";
import System from "../routes/System";

import { CustomToastCloseButton } from "../components/CustomToast";
import ConfirmModal from "../components/ConfirmModal";
import HomePage from "./HomePage/HomePage.js";

class App extends Component {
handlePersistorState = () => {
Expand All @@ -45,7 +44,6 @@ class App extends Component {
<Fragment>
<Router history={history}>
<div className="main-container">
<ConfirmModal />
{this.props.isLoggedIn && <Header />}

<span className="content-container">
Expand All @@ -63,6 +61,10 @@ class App extends Component {
path={path.SYSTEM}
component={userIsAuthenticated(System)}
/>
<Route
path={path.HOMEPAGE}
component={HomePage}
/>
</Switch>
</span>

Expand Down
Loading

0 comments on commit b8c623a

Please sign in to comment.