Questions tagged [express]
Express.js is a minimal and flexible Node.js web application framework providing a robust set of features for building web applications.
express
95,789
questions
0
votes
0
answers
6
views
Serving static files directly in Google App Engine with express
I have a standard Google App Engine environment and am trying to serve some static files for my create-react-app frontend, but I'm not able to do so without copying over the client/build/ files into ...
0
votes
0
answers
12
views
How to generate openapi doc in express
I'm making a REST service using javascript and express. I have some endpoints and I wanna create a swagger file to serve along with it. I'm using swagger-autogen to generate the swagger file. Even ...
3
votes
1
answer
25
views
Typescript: Variable inside Express RequestHandler becomes possibly undefined despite being checked in an if statement [duplicate]
I am creating a way to dynamically create routes before the server fully starts (meaning I'm not creating a route via a request lol that would be crazy), and I stumbled upon this interesting quirk.
...
0
votes
0
answers
7
views
Axios Post Still Blocked Even Though "Access-Control-Allow-Origin", "*" Set On server
In my backend I've set the following endpoint
router.post("/sign-in", async (req, res) => {
try {
//Extracting email and password from the req.body object
const { email, ...
-2
votes
0
answers
22
views
Why res.clearCookie() is not working after deploying to vercel?
First of all, everything works fine when running on localhost.
However, after deploying the app to Vercel when the user tries to log out it should clear cookies with res.clearCookie() but it doesn't ...
0
votes
0
answers
15
views
Aggregate vs Populate methods when to use one in nodejs Mongose
I am creating asset managment tool for warehouse and I have Warehouse , Asset, Category models. I want to get the overall stats of each warehouse like , total assets and how many of them is active or ...
0
votes
1
answer
23
views
Ways to create a login using nodejs
So i am learning nodejs i am trying to create a login
here what I made so far it works
it connects to mongodb and check if the field if same then changing the allow variable to true
any ways to create ...
1
vote
0
answers
21
views
Having trouble sending an image from Express to React client
In express, I'm using the google places api to get city images. I'm having trouble sending the response to my react client.
here's my express route:
router.get('/', async (req, res) => {
const { ...
0
votes
0
answers
9
views
How to handle Authentication and private routes in React-native + Node.js?
I want a good way to handle Authentication in React-Native. I was planning on using JWT tokens and make the accessToken refresh without making the user ever log-in again(assuming they have a ...
-2
votes
0
answers
20
views
Server is started successfully but getapi is not loading in nodesjs [closed]
I am working on an Express.js application and encountered an issue with routing. Here is what I have done so far:
Controller:
exports.dummyLink = (req, res) => {
res.send("this is your dummy ...
0
votes
0
answers
6
views
Creating first Turbo Repo package for a logger failing to import
I am working to setup my first Turbo Repo project using a mix of Next for the UI and Express for the API. I am trying to create a logging package I can include in the API app but also eventually the ...
-1
votes
0
answers
14
views
CSP not showing on browser
I'm quite new to coding, and I'm developing an application using Express, Node JS and Angular. Right now, I am focusing on security, so I did some research and found the Content Security Policy, which ...
0
votes
0
answers
8
views
Node.js Express Server with Axios and MySQL2 stuck in pending preflight OPTIONS request
I am developing a service system where the customer picks up a ticket to be served and the counter selects the ticket numbers of the customers who are waiting in sequence. It is a system that works on ...
0
votes
1
answer
16
views
express-session does not persist session by cross site request
My client/server architecture:
Client (Frontend): Vue (Vite)
Server (Backend): Express.js
Currently i use only the http, because it's a develop enviornment.
For safe request purpose handling, i use ...
0
votes
0
answers
14
views
How can I fix react hooks in a React SSR project?
I try to migrate an existing project in js using express and ejs to render templates. I used react and react-dom. But the issues are that hooks and onChange don't work. I'm going to share the client ...