• Official Website •
Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.- Simple and user-friendly API
- Fast and efficient
- Middleware support
- Extensibility
- Open-source and free
To get started with Avrasya, follow these steps:
- Add Avrasya to your project:
npm install avrasya
- Create your web server:
import Avrasya from "avrasya";
const avrasya = new Avrasya();
avrasya.router.get("/", (context) => {
context.send("Hello World");
});
avrasya.use((context, next) => {
console.log("middleware1");
console.log(context.req.url + " " + context.req.method);
next();
})
avrasya.use((context, next) => {
console.log("middleware2");
next();
})
avrasya.use((context, next) => {
console.log("middleware3");
next();
})
avrasya.listen(3000);
| src
| index.ts
| routes
| get.ts
| user
| get.ts
| [id]
| get.ts
| post.ts
import Context from "avrasya/src/context";
const get = (context: Context) => {
context.send("Hello World");
}
export default get
See Example for more details.
To get started with Avrasya, follow these simple installation steps:
- Clone the Repository:
git clone https://github.com/muhtalipdede/avrasya.git
- Navigate to the Project Directory:
cd avrasya
- Install Dependencies:
npm install
- Start the Application:
npm run start
avrasya.router.get("/css", (context) => {
const css = `
body {
background-color: red;
}
`;
context.css(css);
});
avrasya.router.get("/js", (context) => {
const js = `
console.log("Hello World");
`;
context.js(js);
});
avrasya.router.get("/html", (context) => {
const html = `
<h1>Hello World</h1>
<p>Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.</p>
<button>Click me</button>
`;
context.html(html);
});
avrasya.router.get("/json", (context) => {
const json = {
name: "Avrasya",
version: "1.0.13",
description: "Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility."
};
context.json(json);
});
avrasya.router.get("/text", (context) => {
const text = "Avrasya is a fast and unique Node.js web framework designed for building web applications and APIs. Avrasya stands out with its simple usage, performance, and extensibility.";
context.text(text);
});
avrasya.router.get("/image", (context) => {
const path = "avrasya.png";
context.file(path);
});
avrasya.router.get("/redirect", (context) => {
context.redirect("https://www.google.com");
});
Thank you for considering contributing to this project! CONTRIBUTING
Check out the list of contributors in the CONTRIBUTORS file.
If you want to report an issue or request a new feature, please use the following template. ISSUE_TEMPLATE
This project is licensed under the MIT License. For more information, please refer to the LICENSE File.