Building APIs with Node.js

November 5, 2024

Building APIs with Node.js

Node.js is a powerful runtime for building server-side applications. Let's create a basic API:

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

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

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

This code starts a simple server that responds with "Hello, World!" when accessed.

Related:

◀ Back to home