Skip to main content

Questions tagged [express.js]

Express is a minimal and flexible Node.js web application framework, providing a robust set of features (regex-based routing, sessions, multiple view / templating engines) for building single and multi-page, and hybrid web applications.

Filter by
Sorted by
Tagged with
4 votes
1 answer
66 views

...
user avatar
2 votes
0 answers
109 views

The working code in full is here. It's a To-Do App with a TypeScript backend, written as practice for an upcoming 4-hour interview for a TypeScript backend role. My colleague and I would like to know, ...
Andrew Cheong's user avatar
3 votes
1 answer
141 views

I think the only big improvement that can be made is to check which shard to query based on the userIds of the followed users. One easy way is to check the last ...
user avatar
0 votes
1 answer
66 views

I am refactoring an old project, made in Nodejs with Express, applying the MVC pattern, today it is a fairly simple project: handling of the FCM and Remote Config tools from Firebase. Would it be ...
JRR's user avatar
  • 39
2 votes
1 answer
114 views

I'm currently learning Express.js and I wrote this authentication code. I'm unsure if what i have is correct, how to improve it and if it's secure. For user and session data storage I'm using ...
Krneki123's user avatar
1 vote
1 answer
159 views

This is a simple 2 player game made in NodeJS and the ExpressJS framework with typescript. I've built using OOP approach to as far of an extent as I know of it. I'm really curious as to how further ...
Exodus Reed's user avatar
5 votes
1 answer
95 views

I built a basic authentication system for a node application and I have some security concerns. The username and password the user enters when they log in are stored as plaintext using express-...
HDawG's user avatar
  • 53
2 votes
1 answer
184 views

I have put together a small node application with Express.js and jsonplaceholder. On the homepage, it displays posts by all users. You can also filter posts by one user (author). In ...
Razvan Zamfir's user avatar
4 votes
0 answers
93 views

this is my first real website I created after learning about web development. It's amazing to me that anyone would spare their free time to code review strangers' code. So thank you in advance. I'd ...
Paulemeister's user avatar
1 vote
1 answer
101 views

example: ...
Sha'an's user avatar
  • 125
1 vote
1 answer
855 views

I have created common function for CRUD operations. I am using Sequelize JS, I have created all models in Sequelize I have written stored procedures in mysql for CRUD operations for each module/tables ...
Prasad Gavande's user avatar
2 votes
2 answers
115 views

This code is from my blog project. This project is almost done. This is working well. I can create new posts and update and display all saved posts. ...
Bhaskar's user avatar
  • 123
1 vote
1 answer
130 views

I recently wrote a login function in my express application that does the following: Verifies the user's email and password are correct Generates a JWT Access Token with a short expiry date, and then ...
Tony's user avatar
  • 13
3 votes
0 answers
72 views

My question is have i gotten the three-layered architecture right with error handling etc. I have a webpage containing different resources. The code works but I am not sure if have structured it ...
PreKaGit's user avatar
2 votes
0 answers
60 views

This is not a question related to a bug.I've just created a very tiny node.js/express API for education purposes. I've created a very little ...
Christian LSANGOLA's user avatar
4 votes
1 answer
199 views

My express.js application uses a lot of promises for interacting with a variety of services. Instead of including try/catch with each one, I've setup a fail safe factory method for all my express ...
Josh's user avatar
  • 143
7 votes
2 answers
1k views

I had an interview task which was the final stage, however, the feedback I got back for my solution was that it lacked effort and structure. I would be grateful to ...
user6248190's user avatar
5 votes
1 answer
211 views

I have put together a blogging application with Express, EJS and MongoDB. There is a public, front-end part and a dashboard. In index.js I have: ...
Razvan Zamfir's user avatar
6 votes
1 answer
661 views

router/article.js ...
viviet's user avatar
  • 63
1 vote
1 answer
177 views

I'm practicing back-end programming and NodeJS. As an exercise, I'm attempting to build a REST API for a MongoDB collection. I'm also learning to use the Express and Mongoose middle-wares, so that's ...
NPN328's user avatar
  • 791
2 votes
0 answers
81 views

I am writing an Express.js middleware function in a TypeScript NodeJS project that uses a function from a third-party module to perform a small workload. When writing unit tests, I want to mock this ...
Patrick's user avatar
  • 263
2 votes
1 answer
116 views

This is something I've done a few times, but I've found it to feel a bit error-prone with so many conditions, and am wondering if anyone can point me in the direction of a cleaner way. This is a PATCH ...
Aurast's user avatar
  • 131
2 votes
1 answer
324 views

To learn the ropes of Node.js and Express, I'm trying to implement a very simple REST API. The API says what it should do instead of doing it, so I can focus on the framework's structure. The ...
NPN328's user avatar
  • 791
7 votes
1 answer
401 views

I have this code that fetches data from a 3rd party api and sends it to my backend to be processed. The 3rd party api needs to target the user's localhost address so it has to come from the front end. ...
Adrian Sultu's user avatar
2 votes
1 answer
135 views

I am new to this part of backend development using JS and the truth being a new programming language (for me) it is worrying that it suddenly does not meet the structuring and / or security standards. ...
jecorrales's user avatar
3 votes
0 answers
434 views

I'm looking for a review of my backend code on how to keep it more DRY. I see a lot of repetition in validation part of email and password, also I need some advice on if I have used the try-catch and ...
ubuntu7788's user avatar
3 votes
1 answer
158 views

I wrote an express API for a document management service (repo to be found here) and even though I understand the importance of unit-testing I never quite managed to wrap my head around how I would ...
Felix Wieland's user avatar
0 votes
1 answer
294 views

I took some time to try and solve a problem. I am building a basic Node + Express API. In the app I have created a models folder and will be adding new models as I continue development. I attempted ...
Dewald Els's user avatar
0 votes
1 answer
82 views

I have these following controller functions for registering a user and login, in my app, and I want to make it more clean and maintainable. Probably by using ...
ubuntu7788's user avatar
1 vote
1 answer
60 views

In an api I'm building, I have multiple routes that require an agency to exist before any action is performed on the requested agency. To avoid repetition I've written some middleware to check that ...
mrmadhat's user avatar
  • 168
1 vote
1 answer
111 views

Hello I have a NodeJS which act like an interface it connects the client(mobile app) to the actual server My node JS API receives data from the client to verify it and send it to the server. I want ...
mohamed adel's user avatar
2 votes
1 answer
80 views

I am currently learning how to create nodejs express rest api using async making it fully scaleable and secure. My goal is to ensure maximum functionality and speed, currently I am using MVC ...
Jojo Bagings's user avatar
2 votes
0 answers
49 views

The backend part has the following purposes. An endpoint that takes a search term and returns a list of repositories. An endpoint that allows bookmarking a repository by its id. An endpoint to get all ...
Naveen Chand's user avatar
4 votes
2 answers
101 views

Background A request (req in the code) is made to my server, and a response (res) returned. By the time the response has ...
Tom Hosker's user avatar
1 vote
1 answer
71 views

I am currently creating a website for an artist (my grandfather). My main concern with the code below is readability, as for the most part I have not worked with others on a (programming) project. I ...
MilesZew's user avatar
  • 167
3 votes
1 answer
523 views

We have an upcoming project at work which is going to require working with express.js. I have no prior experience with node.js, so I thought I'd try and do something aside from some courses. Are there ...
Reez0's user avatar
  • 133
2 votes
0 answers
134 views

I'm currently making an app for my side project and I was looking to get some insight on the main js file, what can I improve, the error handling, what am I doing wrong, etc. I'm mostly confused about ...
Anthony's user avatar
  • 21
2 votes
1 answer
545 views

Is this the correct way to block requests in Express? app.js ...
shorif2000's user avatar
2 votes
1 answer
86 views

I am currently working on an Node based Express application. I have found Express's middlewares approach quite pleasing however, we all run in scenarios where a certain route or routes don't need a ...
Talha Akbar's user avatar
4 votes
2 answers
303 views

This is the code for a basic endpoint in my express app routes folder. This firstly renders a page, and then on a continuous loop, renders information about some random "Breaking Bad" character. The ...
Dan Savage's user avatar
4 votes
2 answers
213 views

I am trying to display images from a folder in my project using the "fs" module with NodeJS. I need to read all images in a directory and run them in a loop for them to be displayed. I was able to do ...
Vhin Gabuat's user avatar
2 votes
0 answers
38 views

This is a simple implementation of Django's sample project "Poll" using and express. The controller code: ...
E.ss's user avatar
  • 21
2 votes
0 answers
3k views

Overview I am attempting to learn Node JS with Express by creating a project. I have seen many examples of setting up an express.js application with functional based programming, like so: ...
Gavin Youker's user avatar
4 votes
1 answer
70 views

I have this code for a post request, when the user wants to change his password. Because of all the cases and the following page renders the code came out really ugly. Is there a better way to ...
user3742929's user avatar
2 votes
0 answers
53 views

I've been working on a project to make myself more comfortable with NodeJS, especially Express and TypeScript. Searching and reviewing a lot of approaches of the people, providing bootstraps for it, I ...
Pascal Schrage's user avatar
2 votes
2 answers
2k views

The code below is working properly but how do I make this code faster and more efficient. How do I perfect this code? Let's assume I have 1000 country, state and city records in a mongodb collection. ...
SUMIT VISHWAKARMA's user avatar
4 votes
0 answers
430 views

I'm using Sequelize and Google oAuth for authentication, I want to create a middleware that Verifies the sent token passed in the headers matches the one the user was initially signed to. Finds the ...
CarlosG90's user avatar
  • 141
3 votes
0 answers
77 views

Trying to set up express server that will authenticate a user's Google email before proceeding. The code below works, but is there any way to make it more elegant? The whole ...
Dan G's user avatar
  • 31
4 votes
1 answer
1k views

I have implemented a simple do/while loop to handle a http request to a third-party. I don’t know when the data I receive will have elements in its array so I retry up to 10 times until the array ...
user195155's user avatar
2 votes
2 answers
90 views

I have an express handler which i thought was pretty simple, but CodeClimate flagged this method as having a Cognitive complexity of 6 (5 is the max by default without flagging something) Curious how ...
Catfish's user avatar
  • 123