@sharpps/express
v2.0.0
Published
```typescript // Typescript / ESM import * as express from '@sharpps/express'; ```
Readme
@sharpps/express
Usage
📌 Import as Module
// Typescript / ESM
import * as express from '@sharpps/express';Start Server
// Typescript / ESM
import { createServer, setupService } from '@sharpps/express';
export async function startServer() : Promise<Express> {
const configurators: core.dependecyInjection.IServiceConfigurator[] = [expressDI, di];
const routers:Router[] = [defaultRouter];
return createServer({
services: await setupService(configurators),
routers : { "/" : routers },
view: {
engineName: "ejs",
engine : require("ejs").__express,
publicPaths: [path.join(__dirname, 'public')],
viewPaths: [path.join(__dirname, 'views')],
},
swaggerOptions: {
url: "https://petstore.swagger.io/v2/swagger.json",
oauth: {
clientId: 'swagger',
usePkceWithAuthorizationCodeGrant: true, // Enable PKCE
}
}
});
}
exports = startServer().then(x => x.listen(3100, () => console.log("Running on http://localhost:3100"))).catch(x => console.error(x));