Csaba Kissi Profile picture
Dec 11 β€’ 8 tweets β€’ 3 min read
How to create a simple Express server in Nodejs πŸ‘‡
First, you will need to create a project folder and then install the Express library.

To do this, open a terminal window and type:

npm install express --save
Once installed, create a file called index.js in your project folder.

This is where you'll write the code for your server.

In the index.js file, add the following code to import the Express library and start the server:
const express = require('express');
const app = express();

//create a route handler
app.get('/', (req, res) => {
res.send('Hello World!')
})

const port = 3000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
Finally, run your server by typing the following command in the terminal:

node index.js

Your server should now be running on port 3000.
Open your browser and open this URL: http://localhost:3000

You should see: Hello World!

Congrats! You created your first Express app.
If you like this post, you can bookmark and tag it by replying with @SaveToBookmarks #nodejs #express

You can view your bookmarks on savetobookmarks.com
That's all, guys.

If you found this list useful, consider:

βœ… Follow @csaba_kissi for more content like this
πŸ”” Enable notifications πŸ‘€
πŸ”„ Retweeting the first tweet.

Thanks for your support, guys! πŸ™πŸ€

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Csaba Kissi

Csaba Kissi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @csaba_kissi

Dec 13
7 Low code sites web developers may feel illegal to know.

But you know what?

They can save you tens of hours every month (trust me):
{1} @appwrite

Excellent open-source Firebase alternative.

It's a secure backend server for web, mobile & flutter developers.

Out-of-the-box support for:

βœ… Authentication and Users (social logins included)
βœ… Functions
βœ… Database
βœ… Storage

πŸ‘‰ appwrite.io
{2} Carrd

Simple, free, fully responsive one-page sites for pretty much anything

A free platform for building simple, fully responsive one-page sites for pretty much anything.

πŸ”— carrd.co Image
Read 9 tweets
Dec 13
4 different ways to create an Ajax request in Javascript. Image
1. Using the XMLHttpRequest object: Image
2. Using the fetch() method: Image
Read 10 tweets
Dec 10
How to use local storage in Javascript?

Let me show you πŸ‘‡
Browser local storage is a feature of web browsers that enables websites to store data locally on the user’s computer.

This type of storage is used to store information that should persist even after the user has closed the browser.
It can also be used to store small amounts of data that needs to be available for a long period of time, even after the user has left the website.

Let me show you 4 most common methods:
Read 10 tweets
Dec 9
5 interesting APIs you can use for your next project.

Thread πŸ§΅πŸ‘‡
1️⃣ TheRundown

NFL, NBA, WNBA, MLB, NHL, NCAA Football real-time odds, scores, and schedules all in one place.

rapidapi.com/therundown/api…
2️⃣ Custom QR Code with Logo

Create unique looking QR codes with logo, color and design as PNG, SVG, PDF or EPS.

QR Codes can be generated in high quality for print and professional use cases.

rapidapi.com/qrcode-monkey/…
Read 7 tweets
Dec 9
There are 5 types of loops that are commonly used in JavaScript you should know about πŸ‘‡
1️⃣ For loops:

This type of loop is used to execute a block of code a specified number of times.

It has the following syntax:

for (initialization; condition; increment/decrement) {
// code to be executed
}

e.g.

for (let i = 0; i < 10; i++) {
// code to be executed
}
2️⃣ While loops:

This type of loop is used to execute a block of code while a specified condition is true.

It has the following syntax

while (condition) {
// code to be executed
}

e.g.

while (i < 10) {
// code to be executed
i++;
}
Read 10 tweets
Dec 8
The console log is more powerful than most web developers think.

See below πŸ‘‡ Image
Go to stackblitz.com and log in.

Stackblitz is an online code editor (I'm not affiliated with them)

You can even use the local Javascript file to test the following.
Open a new Javascript project. Image
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(