
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Fast & Lightweight JavaScript library for creating modern and secure web applications.
Fast & Lightweight JavaScript library for creating modern and secure web applications.
There is a plan to support multiple runtimes. At the moment, only the Bun.js
runtime is supported.
Install Choco.js using your favorite package manager:
# Using bun
bun add choco.js
You can find more examples under the examples directory.
import Choco from "choco.js";
const app = new Choco.App({ port: 8080 });
app.get("/", (_ctx) => {
return { hello: "world" };
});
app.listen((url) => {
console.log(`Server is running at ${url}`);
});
Choco.js supports middleware for extending functionality. Here are some built-in middleware options:
Logs details about incoming requests.
app.withLogger({
methods: ["GET", "POST"],
});
Enables Cross-Origin Resource Sharing (CORS) support.
app.withCors({
origin: "*",
methods: ["GET", "POST"],
allowedHeaders: ["Content-Type"],
exposedHeaders: ["Content-Type"],
credentials: true,
maxAge: 600,
});
Caches responses for a specified duration.
app.withCache({
expires: 1000 * 10,
maxItems: 100,
maxLength: 1000,
methods: ["GET"],
});
Contributions, issues, and feature requests are welcome! Feel free to check issue page if you want to contribute.
Show your support! Give a ⭐️ if this project helped you! Or buy me a Ko-fi 🙌!
Copyright © 2024 Sammwy. This project is MIT licensed.
FAQs
Fast & Lightweight JavaScript library for creating modern and secure web applications.
We found that choco.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.