Skip to content

Commit

Permalink
add .env
Browse files Browse the repository at this point in the history
  • Loading branch information
hhoomph committed Jan 23, 2020
1 parent a5cce6b commit 7451582
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_HOST = https://api.qarun.ir/api/
Debug_HOST = http://localhost:3000/api/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# misc
.DS_Store
.env
# .env
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
7 changes: 5 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const { join } = require("path");
const { parse } = require("url");
const express = require("express");
const cors = require("cors");
const next = require("next");
const cookieParser = require("cookie-parser");
const port = parseInt(process.env.PORT, 10) || 3000;
Expand All @@ -19,8 +20,10 @@ app
server.use(cookieParser());
server.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Authorization, Accept");
// cors();
// res.header("Access-Control-Allow-Origin", req.header("origin"));
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS,HEAD");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Authorization, Accept, Access-Control-Allow-Headers");
res.header("Access-Control-Allow-Credentials", "true");
next();
});
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"cookie": "^0.4.0",
"cookie-parser": "^1.4.4",
"core-js": "^3.6.4",
"cors": "^2.8.5",
"cross-env": "^6.0.3",
"dotenv": "^8.2.0",
"eslint-plugin-react-hooks": "^2.3.0",
Expand Down
1 change: 1 addition & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ function Page(props) {
}
};
useEffect(() => {
checkProfile();
if (noFriends && profile !== null) {
getUserFromClosestPeople();
//getSuggestionUsers();
Expand Down
1 change: 1 addition & 0 deletions scss/components/productRow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.product_row {
margin: auto;
overflow: hidden;
max-width: 99%;
.cat_title {
margin-bottom: -0.5rem;
padding-right: 0.5rem;
Expand Down

1 comment on commit 7451582

@vercel
Copy link

@vercel vercel bot commented on 7451582 Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.