Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Programmatically detecting Application Mode in Plesk Node.js container

I have a React front-end that uses an Express back-end hosted in separate spaces on the same server. Both elements use Plesk's Node.js application containers. Both elements have a development and ...
Ijava UK's user avatar
1 vote
0 answers
116 views

Instagram Basic Display API does not show images in production (Error: "You need to enable JavaScript to run this app.")

I am trying to implement Instagram Basic Display API in React with Express to display instagram feed images on my webpage. I followed instructions (https://developers.facebook.com/docs/instagram-basic-...
natcheshev's user avatar
1 vote
3 answers
61 views

How to change the port in API after `npm run build`

client/ scriptWhichMakesApiCall/ await axios.get("http://localhost:${REACT_PORT}/api/product-category"); Doing "npm run build". REACT_PORT value is baked into build. ...
Shivam's user avatar
  • 11
1 vote
1 answer
44 views

How can i access evironment variables in present NodeJS from ReactJS

I want to use my .env variable presend in my nodejs root folder in reactjs. I tried using process.env.TEST but i always get undefined. any solutions? My folder structure. Project root |-client | |- ...
Abhishek Kokate's user avatar
0 votes
1 answer
184 views

Unable to deploy on heroku: .env and PORT error

The app works on localhost:3000. I set app.listen(3000). However, when I deploy the app to heroku, it stops working. I updated the code to: port = process.env.PORT || 80 and port = process.env.PORT || ...
codesbya's user avatar
2 votes
0 answers
211 views

electron/chrome reporting outdated cors headers from node.js

A bit of background...I was trying to connect 2 computers on my local network to each other, a React Client on a windows desktop to a Node.js server on mac laptop. To get this working, I had to change ...
yarnpoint's user avatar
0 votes
1 answer
1k views

How to pass request headers from express to index.js in react?

I receive user related information in the request headers in the express server. I want to access these details in index.js to apply conditional routing based on that parameters.Is there a way to ...
abc's user avatar
  • 3
4 votes
1 answer
6k views

Create-React-App .env file directory location (Non-root)

After creating a new web app with create-react-app (CRA), I need to include some environment files for configuring various endpoints. Noticed that CRA comes with the cool dotenv package all ready to ...
heyitsalec's user avatar
0 votes
2 answers
1k views

How use env in webpack?

I created .env and .env.production files with differnt values: API=http://localhost:8082/api/ Created config: var config = {}; config.api = process.env.API; module.exports = config; I try to get ...
Mediator's user avatar
  • 15.4k
1 vote
0 answers
251 views

how can I set envrionmental variable with webpack-dev-middleware?

I have a webpack project that serving files with webpack-dev-middleware. here is the server setup. const webpackMiddleware = require("webpack-dev-middleware"); const webpackHotMiddleware = ...
Yilmaz's user avatar
  • 50.1k
0 votes
1 answer
772 views

.env returns undefined for multiple files

I have two files using .env , both return undefined for variables, I have tried now to set a root .env for both front-end and backend, but still the .env variables are not loading. in the front end ...
user avatar
3 votes
2 answers
7k views

Node process.env variables empty

I'm building my first Express app, which needs to interact with an API, using an API key that ideally remains secure. So I wanted to follow a basic pattern of keeping the key (and any future ...
Sasha's user avatar
  • 6,476