DeveloperBreeze

Node.js: How to Create an HTTP Server

javascript nodejs
const http = require('http');

const server = http.createServer((req, res) => {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/plain');
    res.end('Hello, World!\n');
});

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

Related Posts

More content you might like

Tutorial

How to Translate URLs in React (2025 Guide)

Create i18n.js:

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';

import en from './locales/en.json';
import fr from './locales/fr.json';

i18n
  .use(LanguageDetector)
  .use(initReactI18next)
  .init({
    resources: { en: { translation: en }, fr: { translation: fr } },
    fallbackLng: 'en',
    interpolation: {
      escapeValue: false,
    },
  });

export default i18n;

May 04, 2025
Read More
Tutorial

Globalization in React (2025 Trends & Best Practices)

Set up your translation files, detect user language, and switch languages dynamically using:

i18n.changeLanguage('ar');

May 04, 2025
Read More
Tutorial

Implementing Internationalization (i18n) in a Large React Application (2025 Guide)

In this tutorial, you'll learn how to implement i18n in a scalable way using i18next, the most popular library for internationalizing React apps.

If you don’t have a project yet, initialize a new one:

May 04, 2025
Read More
Tutorial

Building Micro-Frontends with Webpack Module Federation (2025 Guide)

npm init vue@latest
cd analytics-app
npm install

Install dependencies for Webpack configuration:

May 04, 2025
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Be the first to share your thoughts!