Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT Security NachrichtenIT Security News Daily Summary 2026-09-23(23.09.2026 um 23:55 Uhr)
IT Security NachrichtenIT Security News Hourly Summary 2026-09-24 00h : 7 posts(24.09.2026 um 00:00 Uhr)
IT NachrichtenWindows-Backup Drive Snapshot ist verkauft(24.09.2026 um 00:01 Uhr)
Apple iOS & macOSHow to Always Show Menu Bar on iPad with iPadOS 27(23.09.2026 um 23:38 Uhr)
IT Security NachrichtenIT Security News Daily Summary 2026-09-23(23.09.2026 um 23:55 Uhr)
IT Security NachrichtenIT Security News Hourly Summary 2026-09-24 00h : 7 posts(24.09.2026 um 00:00 Uhr)
IT NachrichtenWindows-Backup Drive Snapshot ist verkauft(24.09.2026 um 00:01 Uhr)
Apple iOS & macOSHow to Always Show Menu Bar on iPad with iPadOS 27(23.09.2026 um 23:38 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Deepening NodeJS Knowledge: URLs, HTTP Methods, Express Framework, and Versioning

Continuing from where we left off, let’s dive deeper into some more advanced topics in NodeJS. If you want to know the basics or you want to read the article series from starting, click here. Parts of a URL and How URLs Work in N…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Continuing from where we left off, let’s dive deeper into some more advanced topics in NodeJS. If you want to know the basics or you want to read the article series from starting, click here.






Parts of a URL and How URLs Work in NodeJS






Parts of a URL



URL stands for Uniform Resource Locator which is used to specify addresses on the web.





  • Components of a URL:



    1. Protocol: The method used to access the resource. (e.g., http, https, ftp)


      • Example: https://








    2. Hostname: The domain name or IP address where the resource is hosted.


      • Example: www.example.com








    3. Port: The port number where the server is listening. (default for http is 80 and for https is 443)


      • Example: :8080 (optional)








    4. Pathname: The path to the specific resource.


      • Example: /path/to/resource








    5. Query String: Key-value pairs used to pass data to the server.


      • Example: ?id=123&name=John








    6. Fragment: A reference to a section within a resource.


      • Example: #section1 (optional)












Example URL:




https://www.example.com:8080/path/to/resource?id=123&name=John#section1









How URLs Work in NodeJS?



NodeJS provides the url module to work with URLs, making it easy to parse and construct them.



Example:




const url = require('url');

// Sample URL
const myURL = 'https://www.example.com:8080/path/to/resource?id=123&name=John#section1';

// Parsing the URL
const parsedURL = url.parse(myURL, true);

console.log(parsedURL);






Output:




Url {
protocol: 'https:',
slashes: true,
auth: null,
host: 'www.example.com:8080',
port: '8080',
hostname: 'www.example.com',
hash: '#section1',
search: '?id=123&name=John',
query: { id: '123', name: 'John' },
pathname: '/path/to/resource',
path: '/path/to/resource?id=123&name=John',
href: 'https://www.example.com:8080/path/to/resource?id=123&name=John#section1'
}






Explanation: The url.parse() function breaks down the URL into its components, making it easier to work with each part.






URL Package for NodeJS and Its Important Functions






url.parse()



It parses a URL string into an object containing properties such as protocol, hostname, pathname, query, etc.





  • Usage:




  const parsedURL = url.parse('https://www.example.com:8080/path/to/resource?id=123&name=John#section1', true);
console.log(parsedURL.hostname); // 'www.example.com'









url.format()



It converts a URL object back into a URL string.





  • Usage:




  const urlObject = {
protocol: 'https',
hostname: 'www.example.com',
port: '8080',
pathname: '/path/to/resource',
query: { id: '123', name: 'John' },
};

const formattedURL = url.format(urlObject);
console.log(formattedURL); // 'https://www.example.com:8080/path/to/resource?id=123&name=John'









url.resolve()



It resolves a target URL relative to a base URL.





  • Usage:




  const base = 'https://www.example.com/home/';
const relative = 'about';

const resolvedURL = url.resolve(base, relative);
console.log(resolvedURL); // 'https://www.example.com/home/about'









Methods of HTTP






Overview of HTTP Methods



HTTP methods define the type of action to be performed on a resource. They are the foundation of RESTful web services.





  • Common HTTP Methods:



    1. GET: Retrieve data from the server.


    2. POST: Send data to the server, often to create or update resources.


    3. PUT: Update an existing resource on the server.


    4. DELETE: Remove a resource from the server.


    5. PATCH: Apply partial modifications to a resource.


    6. HEAD: Same as GET, but without the response body.


    7. OPTIONS: Describes the communication options for the target resource.








Working with HTTP Methods in NodeJS



You can handle different HTTP methods in NodeJS by checking the req.method property.



Example:




const http = require('http');

const server = http.createServer((req, res) => {
if (req.method === 'GET') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('GET request received\n');
} else if (req.method === 'POST') {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('POST request received\n');
} else {
res.writeHead(405, { 'Content-Type': 'text/plain' });
res.end(`${req.method} not allowed\n`);
}
});

server.listen(3000, '127.0.0.1', () => {
console.log('Server running at http://127.0.0.1:3000/');
});






Output:





  • GET Request: GET request received


  • POST Request: POST request received


  • Any Other Method: {METHOD} not allowed






Express Framework






What is Express?



Express is a fast, unopinionated, minimalist web framework for NodeJS. It simplifies the process of building web applications and APIs by providing a robust set of features and middleware.






The Problem Express Solves





  • Complexity in HTTP Server Handling:


    • In vanilla NodeJS, managing routes, handling different HTTP methods, and working with middlewares can become cumbersome as the application grows.

    • Express abstracts this complexity, allowing developers to write cleaner and more maintainable code.











How Express Solves the Problem?





  • Routing: Simplifies route handling with a clean syntax.


  • Middleware: Provides a way to handle common tasks such as parsing request bodies, handling cookies, and managing sessions.


  • Error Handling: Centralized error handling mechanism.


  • Third-Party Integrations: Easy integration with various libraries and plugins for extended functionality.






Basic Example of an Express Application



Installation:




npm install express






Code:




const express = require('express');
const app = express();

// Home route
app.get('/', (req, res) => {
res.send('Hello, Express!');
});

// About route
app.get('/about', (req, res) => {
res.send('About Page');
});

// Start the server
app.listen(3000, () => {
console.log('Express server running at http://127.0.0.1:3000/');
});






Output:




  • Navigate to http://127.0.0.1:3000/ -> Displays: "Hello, Express!"

  • Navigate to http://127.0.0.1:3000/about -> Displays: "About Page"






Working of Versioning in NodeJS



NodeJS follows SemVer, which is a versioning scheme using three numbers: MAJOR.MINOR.PATCH.





  • MAJOR: Introduces breaking changes.


  • MINOR: Adds functionality in a backward-compatible manner.


  • PATCH: Backward-compatible bug fixes.






NodeJS Version Management



NodeJS releases come in two types:





  1. LTS Releases: Recommended for most users; focus on stability and security.


  2. Current Releases: Include the latest features but may not be as stable as LTS.






Using Node Version Manager (NVM)



Node Version Manager (NVM) is a tool that allows you to install and switch between different versions of NodeJS easily.



Installation (Linux/MacOS):




curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash






Common NVM Commands:





  • Install a specific version: nvm install 14.17.0


  • Use a specific version: nvm use 14.17.0


  • List installed versions: nvm ls


  • Set default version: nvm alias default 14.17.0






Example of Version Switching



Code:




nvm install 16.0.0
nvm use 16.0.0
node -v # Outputs: v16.0.0

nvm use 14.17.0
node -v # Outputs: v14.17.0


CTI Threat Relationship Graph3 Knoten / 2 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
IR-PLAYBOOK-RCE
HIGH
SOC Incident Playbook: Remote Code Execution (RCE) Defense
1-Click Detection Engineering: Sigma & YARA Rules
SOC Ready
title: Detect Exploitation - Deepening NodeJS Knowledge: URLs, HTTP Methods, Express Framework, and Versioning
id: 33e2bb70-64c3-41d9-8523-ac7d64570535
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Deepening NodeJS Knowledge: UR" ascii wide
    condition:
        any of them
}
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Deepening NodeJS Knowledge: URLs, HTTP Methods, Express Framework, and Versioning

Thematisch verwandte Begriffe: Deepening, NodeJS, Knowledge, URLs · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96550 | A vulnerability was found in sfturing hosp_order up to 627f426331da8086c…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick