Skip to content

Commit f3fd699

Browse files
committed
change the videos file
1 parent 92e5f86 commit f3fd699

8 files changed

Lines changed: 272 additions & 138 deletions

File tree

.github/workflows/front-end.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ name: Upload Frontend
55
push:
66
branches:
77
- main
8-
# paths: null
8+
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
env:
1313
NODE_OPTIONS: --openssl-legacy-provider
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3 #GitHub-provided checkout action to clone my repository into the runner.
16+
uses: actions/checkout@v3 #GitHub-provided checkout action to clone the repository into the runner.
1717
- name: Set up Node.js
18-
uses: actions/setup-node@v3 #Installs Node.js in the runner, so JavaScript commands can be executed.
18+
uses: actions/setup-node@v3 #Installs Node.js in the runner, so JavaScript commands(npm install and npm run build) can be executed.
1919
- name: Install dependencies
20-
run: npm install
21-
working-directory: ./client
20+
run: npm install #npm install command should be executed inside the ./client folder where your frontend project resides.
21+
working-directory: ./client
2222
- name: Build app
2323
run: npm run build
2424
working-directory: ./client
@@ -29,6 +29,7 @@ jobs:
2929
aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
3030
aws-region: eu-west-2
3131
- name: Deploy static site to S3 bucket
32-
run: aws s3 sync ./client/build s3://reccomendationsh --delete #Upload the build to S3 (aws s3 sync)
32+
#uses the AWS CLI command "aws s3 sync" to upload the built frontend files (in ./client/build) to S3 bucket (s3://reccomendationsh).
33+
run: aws s3 sync ./client/build s3://reccomendationsh --delete
3334

3435

Docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
container_name: nice_williamson
88
restart: always
99
ports:
10-
#we map the container port to the host port -- host:container
10+
#we map the host(my laptop) port to the container port -- host:container
1111
- "3000:3000"
12-
12+
#when I visit http://localhost:3000, the request goes to:
13+
# Host port 3000
14+
#Docker forwards it to container port 3000

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# FROM node:18-alpine
2-
# WORKDIR /app/server
3-
# COPY package*.json ./
41

5-
# RUN npm install
6-
# COPY /server .
7-
# CMD ["node","server.js"]
82
FROM node:18-alpine
93

104
# Set the working directory to /app/server
@@ -19,8 +13,8 @@ RUN npm install
1913
# Copy the rest of the server files
2014
COPY server/ .
2115

22-
# Expose port 3000
16+
# the app run on port 3000 (container listen on this port)
2317
EXPOSE 3000
2418

25-
# Define the command to run your app
19+
# Define the command to run the app
2620
CMD ["node", "server.js"]

client/src/App.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ function App() {
4646
}
4747
}
4848

49+
const handleClick = (e) => {
50+
e.preventDefault();
51+
setShowVideos(true);
52+
}
53+
4954
return (
5055
<div className="App">
5156
<header className="appHeader">
@@ -71,7 +76,14 @@ function App() {
7176
</button>
7277
</div>
7378
<div style={{ backgroundColor: "#55BCC9" }}></div>
74-
<Link
79+
<button onClick={()=>handleClick}>Videos</button>
80+
<Videos
81+
show={showVideos}
82+
setShow={setShowVideos}
83+
loadVideo={loadVideo}
84+
setLoadVideo={setLoadVideo}
85+
/>
86+
{/* <Link
7587
to="/videos"
7688
style={{
7789
color: "#FC4445",
@@ -82,9 +94,9 @@ function App() {
8294
onClick={() => setShowVideos(true)}
8395
>
8496
Videos
85-
</Link>
97+
</Link> */}
8698
</nav>
87-
<Routes>
99+
{/* <Routes>
88100
<Route
89101
path="/videos"
90102
element={
@@ -96,7 +108,8 @@ function App() {
96108
/>
97109
}
98110
/>
99-
</Routes>
111+
</Routes> */}
112+
100113
</div>
101114
);
102115
}

0 commit comments

Comments
 (0)