routes– an array of route objectsrequest- configuration of a request.response- configuration of the response.resourcePath- relative path of the resource to serve, if the request was matched.contentType- optional an override for the resource content type. By default it's automatically deduced from the file MIME type.
Before writing any in-house code, it is wise to check if there already exists a published library for the task at hand. If you're interacting with a service, chances are the developers of the service had taken time to develop official libraries for the more popular programming languages. If it's a task that you suspect is a solved problem, chances are someone has taken the initiative to open source their solution.
Here are the resources to discover libraries and tools for your programming task.
- Search on PyPi – the Python Package Index
- GitHub Code Search
- BitBucket Explorer
- Command Line
pip search+grep, e.g.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # run with sudo user privileges | |
| wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
| sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | |
| sudo chmod 644 /etc/apt/sources.list.d/google-chrome.list | |
| sudo apt-get update | |
| sudo apt-get install google-chrome-stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| IAM boto examples: | |
| In this example we create a group that provides access | |
| to all EC2 and S3 resources and actions and then add a | |
| user to that group. | |
| """ | |
| import boto | |
| # | |
| # First create a connection to the IAM service |
NewerOlder