This example shows how to create a URL shortener using multiple languages and deploy it to the cloud. In this example project we are using Python and NodeJS along with Metacall to run the application.
- Install
metacall
:curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
- Install the requirements:
metacall pip3 install -r requirements.txt
- or
metacall pip3 install requests
- Run the application using
metacall
:metacall main.js
- Deploy the application through the dashboard
- Test the application
- Through your browser:
https://api.metacall.io/{user name}/{deployment name}/{deployment version}/call/shorten?url=
- Using
curl
:curl -X POST https://api.metacall.io/{user name}/{deployment name}/{deployment version}/call/shorten --data '{ "url": "https://github.com/Mostafa-wael" }'
- Through your browser:
You can copy the deployment URL from the dashboard too.