[image] Efesto
A NodeJS framework based on Express, Swagger, Multer, Express-Validator.
Changelog
To see the latest implementation on Efesto, take a look at the Changelog
Installation
install Efesto in your project using
npm install efesto
or
yarn add efesto
Setup
In your app file use express to define the main API path and use the efesto main function as middleware
import efesto from "efesto"
import {createServer } from "http"
class App {
public app: express.Application;
constructor() {
this.app = express();
this.config();
}
private function config(){
this.app.use(
"yourMainApi/path",
efesto({
authMiddleware: yourAuthMiddleware(),
errorMiddleware:yourErrorMiddleware(),
absoluteDirRoutes: "efesto/files/main/path",
relativeDirSwaggerDeclarationsPath: "swagger/generation/out/dir",
isProduction: isProduction,
})
);
}
}
const app = new App().app
const server = createServer(app)
server.listen(4646, ()=>{
console.log("Server listening on port 4646")
})
now your server is ready to go!
Create API paths with efesto
Efesto path generation is based on the structure of the files in the efesto directory.
For example, if you have declared "/efesto" as efesto's main directory and you create the "efesto/users" file the endpoint will be yourApiMain/path/users
.
Parameters in path
Efesto also supports dynamic parameters in the API paths. For example, if your create the "efesto/users/[id]" the endpoint will be yourApiMain/path/users/:id
Usage
each efesto file must have