Skip to content

Commit

Permalink
moved api call to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
rupeshpadhye committed Jul 11, 2020
1 parent 77ce652 commit e3cecd5
Show file tree
Hide file tree
Showing 59 changed files with 12,993 additions and 7,809 deletions.
2 changes: 0 additions & 2 deletions .env.development

This file was deleted.

2 changes: 0 additions & 2 deletions .env.production

This file was deleted.

5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

26 changes: 13 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules
client/node_modules
server/node_modules
client/build
server/build

# testing
/coverage
coverage

# production
/build
build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.development
.env.production
.yarnclean
npm-debug.log
yarn-error.log
*.rdb

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.env.production
39 changes: 39 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "news-lite",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"D": "^1.0.0",
"date-fns": "^1.29.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"history": "^4.7.2",
"material-icons-react": "^1.0.0",
"prop-types": "^15.6.2",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-media": "^1.8.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"react-swipeable-routes": "^0.4.1",
"react-test-renderer": "^16.4.1",
"redux": "^4.0.0",
"redux-mock-store": "^1.5.3",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.2.0",
"typeface-roboto": "^0.0.54"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"sw-precache-webpack-plugin": "^0.11.5",
"webpack-pwa-manifest": "^3.6.2"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions src/index.css → client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -490,5 +490,9 @@ nav {
padding: 0px 16px 16px 8px;
height: 95vh;
overflow-y: scroll;
justify-content: center;
align-items: center;
display: flex;
flex-direction: column;
}

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 6 additions & 9 deletions src/pages/SettingsPage.js → client/src/pages/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import NewsFeedSettingIcon from "../components//NewsFeedSettingIcon";
const InlineStyleObj = {

image: {
'border-radius': '50%',
'text-align':'center',
borderRadius: '50%',
textAlign:'center',
},
imageblock: {
'display':'block',
'margin':'auto',
display:'block',
marginTop: '5px',
},
margin: {
'margin': '5px'
}
}


Expand All @@ -33,8 +30,8 @@ const SettingsPage = (props) => (
<h3>Rupesh Padhye (Developer)</h3>
</div>
<div>
<a className="margin" href="https://github.com/rupeshpadhye" target="_blank" rel="noopener">GitHub</a>
<a className="margin" href="https://www.linkedin.com/in/rupesh-padhye-16301417/" target="_blank" rel="noopener">Linkedin</a>
<a href="https://github.com/rupeshpadhye" target="_blank" rel="noopener">GitHub</a>
<a href="https://www.linkedin.com/in/rupesh-padhye-16301417/" target="_blank" rel="noopener">Linkedin</a>
</div>
</div>
</React.Fragment>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const SET_NEWS_MODE = "news/mode";
export const SET_NEXT_PAGE = "news/pages";
export const REHYDRATE ="persist/REHYDRATE";

const API_KEY = process.env.REACT_APP_API_KEY;
const API_BASE_URL = process.env.REACT_APP_BASE_URL;
//const API_KEY = process.env.REACT_APP_API_KEY;
//const API_BASE_URL = process.env.REACT_APP_BASE_URL;
const defaultLanguage = "en";
const defaultUri = "top-headlines";
const defaultCountry = "wd";
Expand Down Expand Up @@ -176,7 +176,7 @@ export const buileQuery = (
uri = defaultUri,
page= defaultPage,
) => {
let NEWS_API_URL = `${API_BASE_URL}/${uri}?apiKey=${API_KEY}&language=${language}&page=${page}&pageSize=5`;
let NEWS_API_URL = `/api/${uri}?language=${language}&page=${page}&pageSize=5`;
if (country !== "wd") {
NEWS_API_URL = `${NEWS_API_URL}&country=${country}`;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e3cecd5

Please sign in to comment.