a Express fork with new functions
This repository has been archived on 2024-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Matheus Sampaio Queiroga 9dd93d4b24
Some checks failed
Teste / Test in node ${{ matrix.node }} (14.x) (push) Successful in 54s
Teste / Test in node ${{ matrix.node }} (15.x) (push) Failing after 34s
Teste / Test in node ${{ matrix.node }} (16.x) (push) Failing after 31s
Teste / Test in node ${{ matrix.node }} (17.x) (push) Failing after 36s
Teste / Test in node ${{ matrix.node }} (18.x) (push) Successful in 43s
Teste / Test in node ${{ matrix.node }} (19.x) (push) Successful in 44s
Teste / Test in node ${{ matrix.node }} (20.x) (push) Successful in 45s
Publish v3.1.2
2023-12-18 20:34:03 -03:00
.github Add next.js middler and Update code 2023-12-15 22:45:29 -03:00
.vscode Add next.js middler and Update code 2023-12-15 22:45:29 -03:00
src Publish v3.1.2 2023-12-18 20:34:03 -03:00
.gitignore initial commit 2023-08-03 19:30:43 -03:00
.npmignore update layer match 2023-08-16 14:13:42 -03:00
LICENSE initial commit 2023-08-03 19:30:43 -03:00
package.json Publish v3.1.2 2023-12-18 20:34:03 -03:00
README.md Add next.js middler and Update code 2023-12-15 22:45:29 -03:00
tsconfig.json Add next.js middler and Update code 2023-12-15 22:45:29 -03:00

npm Teste

A fork of express with patches and improvements for new integrations, fixes and more.

import neste from "neste";
const app = neste();

app.get("/", (req, res) => res.send("hello world"));
app.get("/json", (req, res) => res.json({message: "hello world"}));

app.listen(3000, () => {
  console.log("Listen on %s", 3000);
});

Example

Standalone Nodejs

import neste from "neste";
const app = neste();

app.get("/", (req, res) => res.set("Content-Type", "text/html").send("<p>Hello world</p>"));

const PORT = Number(process.env.PORT || 3000);
app.listen(PORT, () => console.log("Listen on %s", PORT));

Next.js API Routes

  • path: /[...root].ts
import { Router } from "Neste";
const app = new Router();
export default app;

app.get("/", (req, res) => res.send(`<p>Hello from root API</p>`));
  • path: /form/[...formsSlugs].ts
import { Router } from "Neste";
const app = new Router({ "app path": "/form" });
export default app;

app.get("/", (req, res) => res.send(`<p>Hello from forms router</p>`));

3.x notice

version 3.0.0 is removing support for CommonJS, keeping only the ESM module. if you app/module is Commonjs module migrate to ESM or keep on ExpressJS.

Express middleware's

Important

as a fork of express will be compatible some, probably some others have stopped in the future.