Categories
Mastering Development

MERN express static folder not found and return not found page from react-router-dom

I got a problem after deploying my project to Heroku, so there is an upload image feature by using multer in this application, every image that uploaded will be store inside the uploads folder and then store the path into the MongoDB. so i define the uploads folder as static folder like this: app.use(‘/uploads’, express.static(‘uploads’)); […]

Categories
Mastering Development Software

Basics of software engineering from coding to production

I am embarrassed to ask this but guess I am going ahead ! I am a mechanical engineer who "learnt" the basics C, C++ 15 years ago. I have been designing some old-school hardware products and recently started working with a team of software engineers on IoT devices. Are there any links that explain the […]

Categories
Mastering Development System & Network

Nginx directing to wrong server name

I am trying a bunch of things on my Node webapp hosted on DigitalOcean and this is how the NGINX’s configuration file looks like. server { server_name maindomain.xyz www.maindomain.xyz; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade’; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } #Another location here } server { server_name […]

Categories
Mastering Development

Unable to load preload script – Electron.js Ubuntu 18.04.4

I’m trying to understand how to effectively load the proload.js file in electron: Version "electron": "^9.1.2", Version "electron-builder": "^22.8.0", In background.js I put webPreferences: { nodeIntegration: false, contextIsolation: true, //preload: path.join(app.getAppPath(), "preload.js"), preload: path.join(__dirname, "./preload.js"), }, preload.js and background.js are in the same folder: src folder. this is my preload.js : const { contextBridge, ipcRenderer […]

Categories
Mastering Development

Django React Image wont display

So I recently was trying to deploy my website and I was able to get everything working. However, the images are broken for some reason. I can actually add images to the database fine (easily able to add and change the image itself). However, when I click on the link I go nowhere instead of […]

Categories
Mastering Development

issue in shell script inside groovy which is passing two different types of parameters

A overview of the scenario: i want a dictionary/map which will have this type of structure: it’s key will be: a directory name it’s value will be: the total number of changes of files for that dir i have a list which has the directory names. [ms_dir] is that list Now, I am writing a […]

java.lang.IllegalArgumentException: Expected named arguments but got [checkout, build, deploy]

I’m trying to do parallel stages dynamically, hence defining the to be stage names inside a list. Getting the above error. Below is my code: pipeline{ agent any stages{ stage(‘Integration Tests’){ steps{ script { doDynamicParallelSteps() } } } } } def doDynamicParallelSteps(){ tests = [‘checkout’, ‘build’, ‘deploy’] for (f in tests) { node { stage("${f}") […]

My POST request is NOT ALLOWED when in a production environment

This is my first time posting for help so please bear with me. I’ve created a react app that uses express to create payment intents with Stripe. Locally on my machine, the app works perfectly fine. I can navigate to the page that fetches the POST method and creates a payment intent that I can […]

Categories
Mastering Development

Docker-compose: nginx fails to start due to “permission denied” error

I’m trying to build gatsby + nginx containers to deploy it online. Docker fails when executing COPY from the gatsby container to the nginx container (/app/public to /usr/share/nginx/html). It says it’s a permission issue, but I am doing a chown nginx:nginx (assigning ownership to nginx user). Anything else I’m missing? web-nginx | nginx: [emerg] mkdir() […]

Categories
Mastering Development

Upgrading Node JS and ERR_REQUIRE_ESM: Must use import to load ES Module: ‘inheritsloose.js’ of Babel Runtime

The following error is emitted in my Node JS/React JS application after upgrading Node JS to v.12. I’m currently using @babel/core 7.10.1. How should this error be resolved? Here is my babel.config.js: module.exports = { presets: [ [ ‘@babel/preset-env’, { targets: { node: ‘current’, }, }, ], ‘@babel/preset-react’, ‘@babel/preset-typescript’, ], plugins: [ ‘@babel/plugin-proposal-class-properties’, [‘@babel/plugin-proposal-decorators’, { […]