Skip to content

Commit 84fa2fe

Browse files
authored
Merge pull request #220 from sammychinedu2ky/development
Fixed some issues in relation to http headers, profile links and proxies
2 parents 5f39e11 + 4f68ea2 commit 84fa2fe

File tree

14 files changed

+138
-79
lines changed

14 files changed

+138
-79
lines changed

netlify-functions/getBlogs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const axios = require("axios");
22
const xml2js = require("xml2js");
33

4-
exports.handler = async (event, context, callback) => {
4+
exports.handler = async () => {
55
const mediumURL = "https://medium.com/feed/codeuino";
66
try {
77
const response = await axios.get(`${mediumURL}`);
88
const data = response.data;
99
xml2js.parseString(data, (err, result) => {
1010
const sendthis = result.rss.channel[0].item.slice(0, 3);
11-
callback(null, {
11+
return ( {
1212
statusCode: 200,
1313
headers: {
1414
"Access-Control-Allow-Origin": "*"

netlify-functions/getLikedTweets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const TwitterAxios = require("../src/helpers/twitterAxios");
22

3-
exports.handler = async (event, context, callback) => {
3+
exports.handler = async () => {
44
try {
55
const likedTweetsResponse = await TwitterAxios.get(
66
"/favorites/list.json?count=50&screen_name=codeuino"
77
);
88

9-
callback(null, {
9+
return ({
1010
statusCode: 200,
1111
headers: {
12-
"Access-Control-Allow-Origin": "*"
12+
"Access-Control-Allow-Origin": '*'
1313
},
1414
body: JSON.stringify(likedTweetsResponse.data)
1515
});

netlify-functions/getTweets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const TwitterAxios = require("../src/helpers/twitterAxios");
22

3-
exports.handler = async (event, context, callback) => {
3+
exports.handler = async () => {
44
try {
55
const allTweetsResponse = await TwitterAxios.get(
66
"/statuses/user_timeline.json?screen_name=codeuino&count=100"
77
);
88

9-
callback(null, {
9+
return ({
1010
statusCode: 200,
1111
headers: {
12-
"Access-Control-Allow-Origin": "*"
12+
"Access-Control-Allow-Origin": '*'
1313
},
1414
body: JSON.stringify(allTweetsResponse.data)
1515
});

package-lock.json

Lines changed: 81 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"highlight.js": "^9.17.1",
1616
"history": "^4.10.1",
1717
"html-to-markdown": "^1.0.0",
18+
"http-proxy-middleware": "^1.0.5",
1819
"list-react-files": "^0.2.0",
1920
"markdown-it": "^10.0.0",
2021
"markdown-it-abbr": "^1.0.4",
@@ -54,7 +55,7 @@
5455
"scripts": {
5556
"lambda-serve": "netlify-lambda serve netlify-functions",
5657
"heroku-postbuild": "npm run build",
57-
"start": "serve -s build -l 3000",
58+
"start": "netlify-lambda serve netlify-functions & serve -s build -l 3000",
5859
"prebuild": "netlify-lambda build netlify-functions",
5960
"build": "CI=false || set \"CI=false\" && react-scripts build",
6061
"test": "react-scripts test",
@@ -79,4 +80,5 @@
7980
"devDependencies": {
8081
"gh-pages": "^3.1.0"
8182
}
82-
}
83+
84+
}

src/components/Medium/Medium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Medium extends React.Component {
1919
}
2020
};
2121
componentDidMount() {
22-
this.fetchBlogs();
22+
//this.fetchBlogs();
2323
}
2424

2525
render() {

src/components/Testimonials/Testimonials.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ const Testimonials = () => {
3737
containerClass="testimonial-container"
3838
itemClass="testimonial-item"
3939
>
40-
{Data.map((testimonial) => {
40+
{Data.map((testimonial,index) => {
4141
return (
42-
<div class="testimonial-card">
43-
<div class="testimonial-card-text">{testimonial.quote}</div>
44-
<div class="testimonial-card-footer-container">
45-
<div class="testimonial-card-footer">
46-
<div class="testimonial-image">
42+
<div className="testimonial-card" key={index}>
43+
<div className="testimonial-card-text">{testimonial.quote}</div>
44+
<div className="testimonial-card-footer-container">
45+
<div className="testimonial-card-footer">
46+
<div className="testimonial-image">
4747
<Image
4848
alt="User Image"
4949
width="100%"
5050
src={testimonial.image}
5151
/>
5252
</div>
53-
<h3 class="testimonial-person-name">{testimonial.name}</h3>
54-
<h4 class="testimonial-person-role">{testimonial.role}</h4>
55-
<p class="testimonial-person-description">
53+
<h3 className="testimonial-person-name">{testimonial.name}</h3>
54+
<h4 className="testimonial-person-role">{testimonial.role}</h4>
55+
<p className="testimonial-person-description">
5656
{testimonial.description}
5757
</p>
5858
</div>

src/components/Twitter/Twitter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Twitter extends React.Component {
3333
axios
3434
.get(base + "/getLikedTweets")
3535
.then((Response) => {
36+
console.log(Response);
3637
this.likedTweets = Response.data;
3738
this.loadLikedTweets();
3839
})
@@ -64,6 +65,7 @@ class Twitter extends React.Component {
6465
};
6566

6667
render() {
68+
6769
return (
6870
<React.Fragment>
6971
<Row className="twitter-container">

src/helpers/apiBase.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export default process.env.NODE_ENV === "development"
2-
? "http://localhost:9000"
3-
: "/.netlify/functions";
1+
export default "/.netlify/functions"
2+

src/pages/Home/Components/Collaborate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ const Collaborate = () => {
8989
/>
9090
<Row className="about-card-container">
9191
{collaborationMethods.map((ele, index) => (
92-
<Col sm={6} md={4} lg={3} className="collaborate-card-container">
93-
<CollaborateCard {...ele} key={index} />
92+
<Col key={index} sm={6} md={4} lg={3} className="collaborate-card-container">
93+
<CollaborateCard {...ele} />
9494
</Col>
9595
))}
9696
</Row>

0 commit comments

Comments
 (0)