Skip to content
Sign upLog in
← Back to Community

Express app in 1 line of code

Profile icon
RohilPatel

Express app in 1 line of code

When coding, you usually see people make express apps in like 4 or 5 lines of code, for neatness. However, nobody seems to say that you can do this in 1 line of code, even to display HTML, in which you would just replace the .get with .use. I just thought this would be a cool way to code, and it just so happened to work.

Please Upvote if you think this is cool

Also eat a cookie if you think this is dumb lol.

SHARE YOUR THOUGHTS BELOW!!!

Voters
Profile icon
RobuxMan3
Profile icon
Invictor111
Profile icon
AkoZai
Profile icon
YukiiThanh
Profile icon
Noob13rbeisn
Profile icon
Flipster266A
Profile icon
sanhnathnilhy
Profile icon
CodyChoo
Profile icon
RohilPatel
Comments
hotnewtop
Profile icon
Zavexeon
require('http').createServer((req, res) => res.end('owo')).listen(3000, () => console.log('Listening on port 3000'))
Profile icon
RohilPatel

What are you trying to say?

@Zavexeon

Profile icon
Zavexeon

@RohilPatel
One line web app without installing express :3.

Profile icon
RohilPatel

Lol

@Zavexeon

Profile icon
Highwayman

I’m pretty sure I did the same exact thing the other day lol. Nice though I guess.

Profile icon
RohilPatel

Thanks! Pls upvote if you found it satisfying

@Highwayman

Profile icon
Highwayman

@RohilPatel
I find the fact that we can do this type of thing satisfying, but no I didn’t find this repl satisfying. Sorry.

Profile icon
RohilPatel

Haha lol. I wonder if we could import multiple modules in the same line of code.........

@Highwayman

Profile icon
Highwayman

@RohilPatel
I would think so lol