{"library":"my-server","title":"My Server Minimal HTTP Server","description":"My Server (npm package `my-server`) is a minimalist, zero-dependency HTTP server for Node.js. It allows developers to quickly set up a simple web server to serve files or respond to HTTP requests with custom handlers. Currently stable at version 2.0.7, the package was last published in January 2020, suggesting a low-cadence or maintenance mode of development, with no significant updates since. Its primary differentiator is its extreme simplicity and lack of external dependencies, making it suitable for lightweight use cases like local development, prototyping, or basic API mocking, without the overhead of larger frameworks.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install my-server"],"cli":{"name":"my-server","version":null}},"imports":["const server = require('my-server')();","server.listen(5000);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const server = require('my-server')();\n\n// Register a universal handler for all incoming requests\nserver.all(function (req, res) {\n  // Log details of the incoming request\n  console.log(`Received ${req.method} request for ${req.url}`);\n  // Respond with a JSON object containing request details\n  res.json({\n    headers: req.headers,\n    method: req.method,\n    range: req.headers.range,\n    url: req.url\n  }, 0, 2); // The 0 and 2 are indentation arguments for JSON.stringify\n});\n\n// Start the server on port 5000\nconst port = process.env.PORT ?? 5000;\nserver.listen(port, () => {\n  console.log(`My Server is running on http://localhost:${port}`);\n  console.log('Access http://localhost:5000/some/path to see response.');\n});","lang":"javascript","description":"Demonstrates setting up a basic `my-server` instance, registering a universal handler for all routes, and starting the HTTP server on a specified port, outputting request details as JSON.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}