https://github.com/thomas-basham/capital-finder-thomas-basham
https://github.com/thomas-basham/capital-finder-thomas-basham
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thomas-basham/capital-finder-thomas-basham
- Owner: Thomas-Basham
- Created: 2022-05-09T20:48:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-10T00:53:22.000Z (about 3 years ago)
- Last Synced: 2024-12-31T00:43:59.500Z (6 months ago)
- Language: Python
- Homepage: capital-finder-thomas-basham.vercel.app
- Size: 4.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Lab: Serverless Functions
## Overview
**Deploy a serverless function to the cloud**.**Feature Tasks and Requirements**:
1. [x] Sign up with [Vercel](https://vercel.com/docs/get-started)
2. [x] Create a repository on Github and link it to Vercel account.
3. [x] Use [requests](https://docs.python-requests.org/en/latest/) library to interact with REST [Countries API](https://restcountries.com/#rest-countries)
4. [x] Create a serverless function following Vercel’s get-started directions that handles two kinds of queries:
5. [x] The serverless function should handle a GET http request with a given country name that responds with a string with the form The capital of X is Y
6. [x] E.g./capital-finder?country=Chile should generate an http response of The capital of Chile is Santiago.
7. [x] The serverless function should handle a GET http request with a given capital that responds with a string with the form The capital of X is Y
8. [x] E.g./capital-finder?capital=Santiago should generate an http response of Santiago is the capital of Chile.## Deployed Functions
[Capital](https://capital-finder-thomas-basham.vercel.app/api/countries?capital=Santiago)[Country](https://capital-finder-thomas-basham.vercel.app/api/countries?country=chile)
## Resources
[Vercel](https://vercel.com/docs/concepts/functions/serverless-functions/supported-languages#python)[Vercel Cli](https://vercel.com/docs/concepts/deployments/overview#vercel-cli)