App.js Micro Web Framework

0.1.0 · abandoned · verified Sun Apr 19

The 'app' package is a minimalistic JavaScript web application development framework designed for Node.js, building upon the Connect middleware. Originating around 2011 (as indicated by the copyright and early version `0.1.0`), it aimed to provide a simple, routes-based approach to handling HTTP requests. Its design is reminiscent of early Node.js frameworks, focusing on direct request/response handling and middleware chaining via Connect. Due to its age, it is no longer actively maintained and should be considered for historical reference or extremely niche legacy projects rather than new development. It predates modern Node.js features, async/await, and popular frameworks like Express.js or Fastify, which offer more robust features and active communities.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the basic setup, defines a simple route for the root path, and starts the HTTP server to respond with 'Hello World'.

const App = require('app');
const app = new App();

// Define a route for the root path
app.routes({
  '': function (req, res, next){
    res.send('Hello World');
  }
});

// Start the server on port 3000
const PORT = process.env.PORT ?? 3000;
app.listen(PORT, () => {
  console.log(`App listening on http://localhost:${PORT}`);
  console.log('Open your browser to see "Hello World"');
});

view raw JSON →