- Hosts apps either locally or on cloud
- For local: spins up go routines as servers for multiple apps.
- For cloud: Deploys and hosts on netlify
- [Not required for deploy_type local] export NETLIFY_TOKEN="Personal access token"
- [Not required for deploy_type local] export INDEX_FILE_PATH="path to idex file that returns hello world"
- Run using
go run main.go
This will run the platform server
- Get the cli code from https://github.com/goyalbhumika/multitenant-hosting-cli
- Build the cli
go build -o mycli
- Deploy using './mycli create-app --name crazy-app-107 --deploy_type cloud' for cloud
- Deploy using './mycli create-app --name crazy-app-107 --deploy_type local' for local
Output of cli would be: App created successfully: {Name:app-2 Port:9002 DNS:app-2.gravityfalls42.hitchhiker}
- Add
app-2.gravityfalls42.hitchhiker
to /etc/hosts - Access using curl http://app-2.gravityfalls42.hitchhiker:9002
- The above command returns "Hello world app-2"
- Deployment should be done on netlify with a DNS provided by netlify.
- To create custom DNS, use duck DNS and add to netlify custom domain.