Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
9

Express app in 1 line of code

RohilPatel
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!!!

3 years ago
You are viewing a single comment. View All
1
Zavexeon
Zavexeon
require('http').createServer((req, res) => res.end('owo')).listen(3000, () => console.log('Listening on port 3000'))
3 years ago
1
RohilPatel
RohilPatel

What are you trying to say?

@Zavexeon

3 years ago
1
Zavexeon
Zavexeon

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

3 years ago