File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "posts" : [
3+ { "id" : 1 , "title" : " json-server" , "author" : " typicode" },
4+ { "id" : 2 , "title" : " test" , "author" : " yourAuthor" }
5+ ],
6+ "comments" : [
7+ { "id" : 1 , "body" : " some comment" , "postId" : 1 }
8+ ],
9+ "profile" : { "name" : " typicode" }
10+ }
Original file line number Diff line number Diff line change 1+ import { ServerFactory , AppConfig } from '../src/index' ;
2+ import express from 'express' ;
3+
4+ const server = express ( ) ;
5+ const defaultConfig = new AppConfig ( ) ;
6+ defaultConfig . readOnly = false ;
7+ defaultConfig . jsonFile = 'db.json' ;
8+ defaultConfig . enableSwagger = true ;
9+
10+ const start = async ( ) => {
11+ // do something
12+ await ServerFactory . createServer (
13+ 'local' ,
14+ server ,
15+ defaultConfig ,
16+ '../package.json'
17+ ) ;
18+ } ;
19+
20+ start ( ) ;
You can’t perform that action at this time.
0 commit comments