This JavaScript backend software provides file system-based routing for your convenience. It allows you to define routes using file paths, making it easy to organize and manage your API endpoints.
- Folder file means
localhost:3000/file
. - To add a new route, simply create a folder. For example, creating a
share
folder will result inlocalhost:3000/file/share
. - Routes are controlled by
[id].ts
files for endpoints in the patternlocalhost:3000/file/123
, and___index.ts
files for endpoints in the style oflocalhost:3000/file
. - Zero configuration needed.
- You can create routes with waiting sub-routes using
[id]
folders. For instance, creating a123
folder undershare
will result in a route likelocalhost:3000/file/123/share/456
. - Files starting with
_
(3 underscores) will not be included as endpoint routes and are reserved. - Every route you create will be automatically included in Swagger documentation.
- API versioning is supported. Simply create a folder like
v1
and collect all your routes under it. For example,v1/file/
will contain versioned routes. - Access Swagger documentation for a specific version by accessing
localhost/v1/___docs
.
- The repository includes three simple connectors as templates under the
drivers
folder:- Mongoose
- Firebase
- Sequelize
- Additional drivers such as Prisma and Drizzle may be included as templates in the future.
- Testing library: A testing library will be added, including at least one simple route test.
- Authentication support for Swagger routes: Currently, Swagger routes do not support authentication if an auth controller is present. Future updates may address this limitation.
- Template engine: Consider implementing a template engine like React for server-side rendering of routes.
- Clone this repository.
- Install dependencies:
npm install
- Start the server:
npm start
Contributions are welcome! If you have any ideas for improvements or new features, feel free to open an issue or submit a pull request.