Just looking to slowly migrate our API endpoints f...
# help
j
Just looking to slowly migrate our API endpoints from Serverless Framework to SST. And just reading through this guide: https://docs.serverless-stack.com/migrating/serverless-framework#proxying Just wanted to confirm that this is what it means by the catch-all route? 1. Rename/move api.example.com (Serverless Framework) to old-api.example.com 2. Setup api.example.com in SST 3. Set default route in api.example.com (SST) to old-api.example.com (Serverless Framework) Is my understanding on that correct?
f
Hey @Justin Robinson, u probably don’t want to rename/remove
<http://api.example.com|api.example.com>
off the bat in step 1.
You can try this: 1. Create an API with domain
<http://new-api.example.com|new-api.example.com>
in SST 2. Test
<http://new-api.example.com|new-api.example.com>
is up and running 3. Flip frontend to connect to
<http://new-api.example.com|new-api.example.com>
4. Confirm no more traffic is hitting
<http://api.example.com|api.example.com>
. U might need to wait for a few days as some users might have not re-freshed their browser and are still hitting
<http://api.example.com|api.example.com>
. A good way to check is by looking at the API access log or CloudWatch metrics. 5. Remove the
<http://api.example.com|api.example.com>
domain from ur SLS project 6. Duplicate the API in ur SST app and have the new API use domain
<http://api.example.com|api.example.com>
7. Flip frontend to connect to
<http://api.example.com|api.example.com>
8. Remove the API with
<http://new-api.example.com|new-api.example.com>
from ur SST app.
Let me know if this makes sense
j
Yep, that makes sense thanks! That few days might be longer as we'll need to release the mobile apps with the new endpoint too. Also, looks like SLS uses the RestApi instead of HttpApi. Do you foresee any issues when proxying that request across?