Multiple api's one codebase


#1

Hi I’ve setup nerveless and would like to create a second and third api that both utilize the same core code as the first.

I would like to structure the code as follows if possible but am open to suggestion:

-core_code

  • api1
    –serverless.yml
  • api2
    –serverless.yml
  • api3
    –serverless.yml

I hope this makes sense. I cannot use the authorizer to authorize individual methods in the api with tons due to the AWS cache issue, and must allow * per API, which doesn’t allow me to lock down some routes for admin use, and some for public users.

The issue I am having is including the core files into each root folder of each api.

Any help is appreciated.

Thanks,
John


#2

SOLVED:

nevermind, I got it working using symlinks.

If anyone has a similar issue, here is what I did.

from the root of my main project…

cd api1
ln -s …/core_code ./corecode

And that will link in the core_code directory, and on deploy it will package the core code into the main deployment package. Tested successfully.


#3

Not really get your point, when you say it is resolved.

Are you thinking to fix it with different stages (option of --stage )?