Skip to content

Commit

Permalink
added teraform
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadi38 committed Mar 5, 2024
1 parent 4978c46 commit 7b6a5d0
Show file tree
Hide file tree
Showing 12 changed files with 384 additions and 310 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/front-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,3 @@ jobs:
aws-region: eu-north-1
- name: Deploy static site to S3 bucket
run: 'aws s3 sync ./client/build s3://fullstackprojectaws'
<<<<<<< HEAD
=======







>>>>>>> 1d0f65ee (creating yml file)
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@

node_modules
.env
.env

# Local .terraform directories

**/.terraform/*/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc
40 changes: 39 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
node_modules

node_modules
.env

# Local .terraform directories

**/.terraform/*/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc
26 changes: 17 additions & 9 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React, {useState,useEffect } from "react";
import { BrowserRouter as Router, Route, Routes, Link } from "react-router-dom";
import React, { useState, useEffect } from "react";
import { BrowserRouter as Router, Route, Routes, Link } from "react-router-dom";

import "./App.css";
import Videos from "./Videos.js";

function App() {

const [showVideos, setShowVideos] = useState(false);
const [loadVideo, setLoadVideo] = useState([]);
const [order,setOrder]=useState("ase");
const [order, setOrder] = useState("ase");

useEffect(() => {
const getData = async () => {
try {
const response = await fetch(
"http://ec2-16-171-32-223.eu-north-1.compute.amazonaws.com:3000/videos"
"http://ec2-13-49-244-227.eu-north-1.compute.amazonaws.com:3000/videos"
);
if (!response.ok) {
throw new Error("something went wrong");
Expand All @@ -30,7 +29,6 @@ function App() {
getData();
}, []);


function orderClickHandler(e, newOrder) {
e.preventDefault();

Expand All @@ -56,9 +54,19 @@ function App() {
<nav className="nav">
<div className="orderBtn">
<p>order by rate : </p>
<button onClick={(e) => orderClickHandler(e, "asc")} disabled={order === "asc"}>Ase</button>

<button onClick={(e)=>orderClickHandler(e,"desc")} disabled={order==="desc"}>Desc</button>
<button
onClick={(e) => orderClickHandler(e, "asc")}
disabled={order === "asc"}
>
Ase
</button>

<button
onClick={(e) => orderClickHandler(e, "desc")}
disabled={order === "desc"}
>
Desc
</button>
</div>
<div style={{ backgroundColor: "#55BCC9" }}></div>
<Link
Expand Down
Loading

0 comments on commit 7b6a5d0

Please sign in to comment.