Triton is focused on API development experience and building a framework with Serverless Function in mind and incremental adoption.
1import Database from "tritonjs/database";2import Auth from "tritonjs/auth";34const handler = (5req: FleetRequest,6res: FleetResponse7) => {8res.send("Hello World!");9};1011export const config = {12middleware: [13new Database(...),14new Auth(...)15]16};1718export default handler;
Middleware based
Configure APIs using middleware to connect to database, authenticate, validate, cors.
Learn moreZero Config
APIs are automatically compiled and packaged for production.
Triton is focused on API development experience and building a framework with Serverless Function in mind and incremental adoption.
Easy to deploy in Fleet Function
There is no need to configure any configuration files to deploy to Fleet globally.
Learn moreContinuous deployment with Github Actions
Every git push a new deployment is made and a URL is created to test before going to production.
Learn moreTriton is a framework for NodeJS built with Serverless Functions in mind as opposed to frameworks like Fastify, ExpressJS, Hapi which are built with a monolithic mindset.
Triton's Design is to be simple and Zero Config that allows you to create a fast API just by building a file and oriented to microservice architecture and can be easily deployed in a Serverless Function.
Provider agnostic
Triton makes it possible to deploy the API in different providers that offer serverless function.
Microservice architecture
Serverless functions abstract the need to deal with containers or monitor the status of the service, Triton.js simplifies a create APIs using technology with Node.js.
Incremental Adoption
Adopt Triton incrementally as your codebase adapts to the new architecture.
Developer friendly
Triton offers friendly APIs to improve the development experience.
Triton is a simple and flexible middleware-based framework built for Serverless Function environment.
Built with a focus on development experience to simplify the API development process with microservice architecture in mind.
Learn moreSetup
Routes
APIs are created based on the file system.
API
Configure middleware on your endpoint.
import Auth from "tritonjs/auth";export const get = (req: FleetRequest, res: FleetResponse) => {...};export const post = (req: FleetRequest, res: FleetResponse) => {...};export const config = {name: "User",method: ["GET", "POST"],middleware: [new Cors(),new Validation(...),new Database(...),new Auth(...)]};
Deploy
Configure APIs using middleware to connect to database, authenticate, validate, cors.
Available middlewares
View a list of existing Triton maintained middleware.
Creating Triton middleware
Learn to create a Triton middleware for your project needs.
Triton.js reimagines Node.js frameworks for Serverless Function environments to simplify the development process and scale.
Development Environment
Develop locally, start a local server that simulates the experience of a serverless function.
Lightweight
Triton has a 10.1 kB footprint in core implementation.
Unknown exceptions
Triton catches all unknown exceptions and returns a common message but appends to the log.
Middleware
Use Middleware to configure API access, connect to database, validate data...
Zero Config
APIs are automatically compiled and packaged for production.
File-system Routing
Each file in the api folder becomes a route.
Environment Variables
Triton offers built-in support for environment variables.
Logs
Runtime errors are easy to track, they are exposed in the console.
TypeScript Support
First-class TypeScript support with no configuration required.
Microservices oriented to Serverless architecture,
high availability, easy and quick deployment.
1import Auth from "tritonjs/auth";23const handler = (4req: FleetRequest,5res: FleetResponse6) => {7res.send();8};910export const config = {11middleware: [12new Database(...),13new Auth(...)14]15};1617export default handler;