File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1+ import express from 'express' ;
2+ import {
3+ AppConfig ,
4+ CoreApp ,
5+ Environment ,
6+ FileStorageAdapter ,
7+ PublicStrategy ,
8+ Swagger ,
9+ SwaggerConfig ,
10+ } from '../src/index' ;
11+
12+ const server = express ( ) ;
13+ const appConfig = new AppConfig ( ) ;
14+ const environment = new Environment ( ) ;
15+
16+ const swagger = new Swagger (
17+ server ,
18+ new SwaggerConfig ( appConfig . readOnly , appConfig . enableApiKeyAuth ) ,
19+ environment . basePath ,
20+ appConfig . routes . apiRoutePath ,
21+ './package.json' ,
22+ appConfig . routes . swaggerSpecRoutePath
23+ ) ;
24+
25+ let core = new CoreApp (
26+ appConfig ,
27+ server ,
28+ new FileStorageAdapter ( 'db.json' ) ,
29+ swagger ,
30+ environment ,
31+ new PublicStrategy ( )
32+ ) ;
33+
34+ const init = async ( ) => {
35+ await core ! . setup ( ) ;
36+ console . log (
37+ 'JSON Server is running under port 3000. Use http://localhost:3000/ to access it'
38+ ) ;
39+ server . listen ( 3000 ) ;
40+ } ;
41+ init ( ) ;
You can’t perform that action at this time.
0 commit comments