dimkir / aws-multitenant-architecture-quickstart

Serverless port for AWS Multi Tenant Architecture Concept (check website)
https://www.slideshare.net/AmazonWebServices/deconstructing-saas-a-deep-dive-into-building-multitenant-solutions-on-aws-arc407-reinvent-2017
0 stars 0 forks source link

How configuration works (development vs production) #18

Open dimkir opened 5 years ago

dimkir commented 5 years ago

development

In development environment, feel free to configure everything within the

config/default.json:dev ...

Setting service urls

In development each url has it's own port

            url: {
                tenant: dev.protocol + dev.domain + ':' + port.tenant + '/tenant',
                user: dev.protocol + dev.domain + ':' + port.user +  '/user',
                product: dev.protocol + dev.domain + ':' + port.product + '/product',
                reg: dev.protocol + dev.domain + ':' + port.reg + '/reg',
                auth: dev.protocol + dev.domain + ':' + port.auth + '/auth',
                sys: dev.protocol + dev.domain + ':' + port.sys + '/sys',
                order: dev.protocol + dev.domain + ':' + port.order + '/order'
            }

production

You must set a number of environment variables:

Setting service urls

In production all services live at the same url (THERE IS NO PORT!)

                url: {
                    tenant: prod.protocol + process.env.SERVICE_URL + '/tenant',
                    user: prod.protocol + process.env.SERVICE_URL + '/user',
                    product: prod.protocol + process.env.SERVICE_URL + '/product',
                    reg: prod.protocol + process.env.SERVICE_URL + '/reg',
                    auth: prod.protocol + process.env.SERVICE_URL + '/auth',
                    order: prod.protocol + process.env.SERVICE_URL + '/order',
                    sys: prod.protocol + process.env.SERVICE_URL + '/sys'
                }