Socket.io and nginx CORS on production
I am trying to get an app that uses socket.io v.3.1.1 to work on production. It works well on development using webpack devServer for the client on 3000 and nodemon for the server on 4000. But when I put it…
I am trying to get an app that uses socket.io v.3.1.1 to work on production. It works well on development using webpack devServer for the client on 3000 and nodemon for the server on 4000. But when I put it…
i need some help please, i try to seed some data to mongoDB Atlas, so i code (thanks Basir^^) a api for this : productRouter.get('/seed', expressAsyncHandler(async (req, res) => { console.log('foo'); /* await Product.remove({})*/ const seller = await User.findOne({ isSeller:…
Now im following the Fullstack React GraphQL TypeScript Tutorial I get trouble in connectRedis with express-session;;; import connectRedis from "connect-redis"; import session from "express-session"; ... const RedisStore = connectRedis(session); [ERROR] error TS2345: Argument of type 'typeof session' is not assignable…
I've tried all the ways to handle my errors but error handling middleware is never been called. I tried many ways to handle the error but it seems that code instantly breaks when I throw an error. -- App.js --…
I am a newbie to development and I recently created a MERN Stack Application which uses reactjs as the frontend, Nodejs with express as the Backend, and MongoDB as the Database. After that, I searched for some methods to SEO…
I have an nginx server proxying my express application (which renders ejs files to html), and in trying to load static css/image files it throws a 404 from nginx. This works locally (where I don't have nginx). <!-- This is…
I am using express 4. in my server.js I have express.json() middleware require('dotenv').config(); const express = require('express'); const cors = require('cors'); const mongoose = require('mongoose'); const errorHandler = require('./_helpers/error-handler'); const app = express(); const port = process.env.PORT || 5000; app.use(cors());…
Here's my nginx file: server { server_name domain.net www.domain.net; location / { proxy_set_header X-Real-IP $remote_addr; proxy_pass http://localhost:3000; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/domain.net/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/domain.net/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; #…
When express server is started with SPA application index file and few other static files are loaded and some files throw 500 error NodeJS server is running, and serving the static files from the correct folder. (This can be confirmed…
I have reactjs application with express server. I want to have my application as SEO friendly. I am using react-helmet to add SEO meta tags. How can I check SEO meta tags in dev mode?