,

The Reasons I Chose Express Over NextJS

Posted by






Why I’m Using Express Instead of NextJS

Why I’m Using Express Instead of NextJS

When it comes to building web applications, there are a variety of frameworks and libraries to choose from. Two popular options for building server-side rendered applications are Express and NextJS. Both have their strengths and weaknesses, but for my current project, I’ve decided to go with Express over NextJS.

Customization

One of the main reasons I chose Express is the level of customization it offers. Express is a minimalist web framework for Node.js that allows me to have full control over my server-side logic. I can create custom middleware, define my own routing logic, and integrate third-party libraries without any restrictions. This level of flexibility is important for me as it allows me to tailor the application to my specific needs.

Performance

In terms of performance, Express gives me more control over optimizations compared to NextJS. I can fine-tune the server configuration and caching strategies to improve the application’s speed and reduce latency. While NextJS offers server-side rendering out of the box, I found that I can achieve similar performance results with Express with the right configurations and optimizations in place.

Community and Support

Express has a large and active community with a wealth of resources and documentation available. This makes it easier to find solutions to problems and get support when needed. While NextJS also has a supportive community, I found that Express’s ecosystem aligns better with my project’s requirements and the level of assistance I need.

Conclusion

Both Express and NextJS are powerful tools for building server-side rendered applications, and the right choice ultimately depends on the specific needs of the project. For my current project, the level of customization, performance control, and community support offered by Express make it the ideal choice for me. While NextJS is a fantastic framework with its own set of advantages, Express aligns better with my current development goals and requirements.


0 0 votes
Article Rating
23 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Josh tried coding
11 months ago

Was aware you could self-host NextJS, what I didn't know is that it would just act like a regular nodejs server then. Thanks for sharing, you learn something new every day

Shantanu Kumar
11 months ago

Do you have any resources on integrating Express js backend with Next js 13 and adding authentication (w/o Next Auth, the tokens, etc. is generated on Express backend

Muhammed Özalp
11 months ago

Thanks for that useful content

Andronikus Simarmata
11 months ago

So you are comparing a server-based Express.js to a serverless Next.js instead of a server-based Next.js ? Hmm. 🤔 Since your channel is called 'Josh Tried Coding,' I can forgive it

Suraj Maurya
11 months ago

so why don't you host the app yourself instead of using Vercel?

Eduard Abramovich
11 months ago

what about express vs fastify?

James Bender
11 months ago

The bigger issue for me is that I need to treat the back end and front end differently. I need to scale them differently, my clients need to deploy them to different logical zones, and I need to have different security policies for the front end and back end. I'll use the Next routes for "locally convenient" things for my application, but most of the functionality must be separate.

Din Mavric
11 months ago

are you really comparing a full blown framework with express? very bad comparison

Danial Arshad
11 months ago

If we use express for backend, then what’s the point of using nextjs for frontend instead of pure reactjs?

Anass Sanba
11 months ago

Use netlify functions?

BRP
BRP
11 months ago

i just stomped my head with the size limit on cloud functions whilst using puppeteer and an aws lambda adapter :(( wouldve been great to come across this video earlier today lol

Tom Moore
11 months ago

I'm coming to a similar point of realisation now as I want to integrate GPT-4 into my app at some point in the future. I've got two possible solutions:

1. Using Next api routes for requests that you know will be quick and an express server for requests that will take a while.
2. If the slow request is done based on a user input (like requesting to generate a blog) then why not fetch on the frontend, that doesn't have a timeout limit?

Sina
11 months ago

it really depends on the use cases

Okie
11 months ago

Next tries to be a jack of all trades with its API routes, and Vercel is pushing hard to turn entire stacks into just Next and nothing else. However, I think a lot of devs are calling Next out on this and are realizing that Next really isn't that great for backend at all. I personally think Next is great to increase performance by using SSR/SSG, but you should almost always make your backend in a separate project.

snatvb
11 months ago

so, you can do it with nextjs, but you need to deploy it on different place – not vercel
nextjs != vercel

ahmed akremi
11 months ago

how can use
nextauth with express

Ozzyfromspace
11 months ago

I had this exact issue of stateless function calls while working on a dashboard for a startup as a contractor. I ultimately deployed a standalone go server, same difference. Nice video!

Stanley Coffey
11 months ago

as for the timeout why not just push the job to queue and poll it ?

Hippo bot
11 months ago

Please refrain from developing an AI-powered blog generator.

Creating an AI blog generator may seem appealing, as it promises to save time and effort in content creation. However, there are several reasons to reconsider this idea.

Blogs are meant to express personal thoughts and opinions in an authentic way. By relying solely on AI, the content may lack the human touch that readers value. Human-authored blogs establish deeper connections with the audience, fostering engagement and relatability.

An AI blog generator could contribute to the proliferation of low-quality or irrelevant content. Without human oversight, the generated articles may lack accuracy, coherence, and originality. Maintaining the integrity of the blogosphere requires human judgment and expertise.

Building a successful blog involves nurturing a loyal readership and fostering a community. AI cannot respond to comments, engage in discussions, or adapt to readers' needs. Human interaction is essential for a vibrant and engaged readership.

Ethical concerns surround the use of AI in content generation. There is a risk of propagating biased or misleading information. Adhering to ethical guidelines, respecting privacy, and avoiding plagiarism requires human judgment.

In conclusion, prioritize human creativity, authenticity, and meaningful engagement in blogging. Embracing unique perspectives, insights, and interactions fosters a valuable blogging community. Avoid relying solely on AI for content generation.

Sander Cokart
11 months ago

Still can use next api. Just don't run on the edge