26
4

Here's a reminder that the good people behind Express.js are currently working on Express 5, currently in beta.

27
26
28
7
Node v21.7.1 (nodejs.org)
submitted 7 months ago by mac@programming.dev to c/nodejs@programming.dev
29
13
Node v21.7.0 (nodejs.org)
submitted 7 months ago by mac@programming.dev to c/nodejs@programming.dev
30
2
submitted 8 months ago* (last edited 8 months ago) by mac@programming.dev to c/nodejs@programming.dev
31
8
submitted 9 months ago by mac@programming.dev to c/nodejs@programming.dev
32
1
submitted 9 months ago by mac@programming.dev to c/nodejs@programming.dev
33
1
submitted 9 months ago by mac@programming.dev to c/nodejs@programming.dev
34
1
submitted 9 months ago by mac@programming.dev to c/nodejs@programming.dev
35
1

Hi y'all, sorry if these are really basic questions, but I'm just starting out learning node. I've been developing software for a long time, and web sites / apps for a couple of years, but nothing too advanced yet, mostly in vanilla HTML/JS and a little PHP. I swear I am trying to keep an open mind on all of this but some of these ideas are really new / different for me.

  1. Is Express really just for API development, or can I use it to create a basic web app as well? (I've read others saying this but I find this idea confusing -- e.g.: https://alternativeto.net/software/expressjs/ "Express is for building REST APIs (backend). Meteor is for building the full stack webapp")

  2. Do you get used to the idea of incorporating other people's code into your node projects? (Because as an older developer, all this "just add this framework which has 122 dependencies of its own" seems like mania. How could you ever say a project built on hundreds of other projects [which all have their own dependencies too] could ever be said to be safe or secure? And won't changes in those projects break my project eventually?)

  3. Is there no way to process a POSTed form with just the built-in Node functions when the form enctype is "multipart" -- without adding in Express or some other framework? (I've searched and searched and all the examples I found for doing this without Express assume the form's enctype is "x-www-form-urlencoded" but my form will be used to upload a file.)

Thanks for any advice / info!

36
1
submitted 10 months ago by amargo85@infosec.pub to c/nodejs@programming.dev

For those learning Nodejs, here is a tutorial on how to handle HTTP POST requests.

37
1
38
1
39
1
submitted 10 months ago by mac@programming.dev to c/nodejs@programming.dev
40
1
submitted 10 months ago by eterps@sopuli.xyz to c/nodejs@programming.dev
41
1
submitted 10 months ago by eterps@sopuli.xyz to c/nodejs@programming.dev
42
6
submitted 10 months ago by mac@programming.dev to c/nodejs@programming.dev
43
3
submitted 11 months ago by mac@programming.dev to c/nodejs@programming.dev
44
6
submitted 11 months ago by mac@programming.dev to c/nodejs@programming.dev
45
10
submitted 11 months ago by mac@programming.dev to c/nodejs@programming.dev
46
3
47
1
Node v21.2.0 (nodejs.org)
submitted 11 months ago* (last edited 11 months ago) by lysdexic@programming.dev to c/nodejs@programming.dev
48
7
submitted 11 months ago* (last edited 11 months ago) by DonBubbles@lemmy.world to c/nodejs@programming.dev

Since Node.js v20.6 instead of using the popular dotenv package to read your .env file and make its values available under process.env, you can now pass --env-file .env to node to achieve the same, without a dependency.

Find out more...

Here is an example of the changes needed to upgrade:

config.ts config.ts diff

package.json package.json diff

Tipp: If you deploy your app as a Docker container, don't forget to add .env to your .dockerignore file, as typically you will explicitly set your environment variables in your deployment and don't want your .env file to interfere with that.

49
1

I’ve been intrigued by FxTS and radash lately

50
1
submitted 11 months ago* (last edited 11 months ago) by DonBubbles@lemmy.world to c/nodejs@programming.dev

Very happy that with the new --experimental-default-type module in Node.js v21 I can write my little helper commands, that I run directly in the terminal using --eval/-e, in ESM syntax now. E.g. to generate a hex JWT secret:

node --experimental-default-type module -e "import crypto from 'node:crypto'; console.log(crypto.randomBytes(32).toString('hex'));"

Find out more...

view more: ‹ prev next ›

Node.js

216 readers
4 users here now

founded 1 year ago
MODERATORS