File tree Expand file tree Collapse file tree 2 files changed +28
-10
lines changed
Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,12 @@ There are components managed: (under /packages)
214214make install
215215```
216216
217+ Lerna will be used to manage the monorepo`s dependencies.
218+
219+ ```
220+ lerna bootstrap
221+ ```
222+
217223### Start the server component
218224
219225```bash
@@ -224,13 +230,13 @@ the json file will be loaded directly from your local filesystem. No AWS access
224230
225231### Start the template component
226232
227- Mind: Ensure you have AWS credentials in place due to requests to S3 bucket .
233+ This part is using the serverless offline and is close to how the solution behaves in the cloud .
228234
229235``` bash
230236make start-template
231237```
232238
233- the json file will be loaded directly from the s3 bucket. This is very close to how the solution behaves in the lambda and aws cloud .
239+ the json file will be loaded directly from your local filesystem. No AWS access is needed .
234240
235241### Start the cli component
236242
Original file line number Diff line number Diff line change 88 S3StorageAdapter ,
99 CloudEnvironment ,
1010 CoreApp ,
11+ FileStorageAdapter ,
1112} from 'json-serverless-lib' ;
1213
1314import fs from 'fs' ;
@@ -25,17 +26,28 @@ const swagger = new Swagger(
2526 './package.json'
2627) ;
2728
28- const core = new CoreApp (
29- appConfig ,
30- server ,
31- new S3StorageAdapter ( environment . s3Bucket , environment . s3File ) ,
32- swagger ,
33- environment
34- ) ;
29+ let core : CoreApp | undefined ;
30+ if ( process . env . IS_OFFLINE ) {
31+ core = new CoreApp (
32+ appConfig ,
33+ server ,
34+ new FileStorageAdapter ( 'db.json' ) ,
35+ swagger ,
36+ environment
37+ ) ;
38+ } else {
39+ core = new CoreApp (
40+ appConfig ,
41+ server ,
42+ new S3StorageAdapter ( environment . s3Bucket , environment . s3File ) ,
43+ swagger ,
44+ environment
45+ ) ;
46+ }
3547
3648const init = async ( ) => {
3749 return new Promise ( async ( resolve , reject ) => {
38- await core . setup ( ) ;
50+ await core ! . setup ( ) ;
3951 resolve ( ) ;
4052 } ) ;
4153} ;
You can’t perform that action at this time.
0 commit comments