1.0.1 • Published 5 months ago

barenode v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 months ago

��# FastNode

FastNode is a lightweight, minimalist HTTP server framework for Node.js that simplifies route handling and file serving.

Features

  • Simple route registration
  • Easy file serving
  • Flexible request and response handling
  • Lightweight and minimal overhead

Installation

npm install fastnode

Quick Start

const FastNode = require("fastnode");
const app = new FastNode();

// Define a route
app.route("get", "/hello", (req, res) => {
  res.send({ message: "Hello, World!" });
});

// Serve a file
app.route("get", "/file", (req, res) => {
  res.sendFile("./example.txt", "text/plain");
});

// Start the server
app.listen(3000, () => {
  console.log("Server running on port 3000");
});

API Reference

new FastNode()

Create a new FastNode server instance.

route(method, path, callback)

Register a route handler.

  • method: HTTP method (get, post, etc.)
  • path: URL path
  • callback: Request handler function

listen(port, callback)

Start the server on the specified port.

Upcoming Features

  • Middleware support
  • Dynamic route parameters
  • Advanced error handling
  • Request body parsing
  • CORS support
  • WebSocket integration
  • Logging middleware
  • Static file serving

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT License

1.0.1

5 months ago

1.0.0

5 months ago

0.12.0

4 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.2

10 years ago

0.2.1

10 years ago