Adrián Mouly
06/07/2021, 10:01 AM/tasks
and service 2 uses /tasks/{id}/responses
…
Currently what I do is exporting the GW ID into CF from a parent SLS project and re-using that ID on the child projects (service 1 and 2).
How is this pattern supposed to be done on SST? Should I have 1 parent-stack and somehow reuse it from my 2 child projects?
I’m in the process of investigating what is needed to migrate my infrastructure from SLS to SST.Frank
// stackA.js: create the api
this.api = new sst.Api(this, "MyApi", ...);
// index.js: pass the api to stackB's props
const stackA = new StackA(app, "stackA");
new StackB(app, "stackB", { api: stackA.api });
// stackB.js: add additional routes
props.api.addRoutes(this, ...);
Frank
Frank
Frank
Frank
Frank
Adrián Mouly
06/07/2021, 6:17 PMMr.9715
06/08/2021, 5:44 AMhttpApi
looks like this
functions:
simple:
handler: handler.simple
events:
- httpApi: 'PATCH /elo'
extended:
handler: handler.extended
events:
- httpApi:
method: POST
path: /post/just/to/this/path
where as REST API looks like this,
candidateDetails:
handler: api/candidate.get
events:
- http:
path: candidates/{id}
method: get
P.S - I never used sls, I looked these up. Let me know if you agree.Adrián Mouly
06/08/2021, 5:52 AMAdrián Mouly
06/08/2021, 5:53 AMhttp
and httpApi
, hahaha.Adrián Mouly
06/08/2021, 5:53 AMAdrián Mouly
06/08/2021, 5:53 AMMr.9715
06/08/2021, 5:59 AMAdrián Mouly
06/08/2021, 6:02 AMAdrián Mouly
06/08/2021, 6:03 AMAdrián Mouly
06/08/2021, 6:03 AM