You are going to write a simple webserver that remembers how many times an endpoint is called.
Create a simple webserver that responds to '/' by returning hello world
. I.e.
$ curl http://localhost:5000/
hello |
SKU | price | price | image | title | brand |
---|
[ | |
{"sku": "001", "title": "appl", "price": 10}, | |
{"sku": "002", "title": "orange", "price": 7} | |
] |
### Keybase proof | |
I hereby claim: | |
* I am zetafish on github. | |
* I am zetafish (https://keybase.io/zetafish) on keybase. | |
* I have a public key ASDMpVAmV-mm1ihBe45NeLO0WNLO44EiTUFQaADfNOwRCQo | |
To claim this, I am signing this object: |
[{"name": "Mazzel", "kind": "dog"}, | |
{"name": "Shanti", "kind": "cat"}] |
(ns zetafish.aws.credentials | |
(:require [clojure.java.io :as io] | |
[clojure.tools.logging :as log] | |
[cognitect.aws.client.api :as aws] | |
[cognitect.aws.credentials :as credentials])) | |
(defn- web-identity-token-credentials-provider | |
"Returns credentials from AWS_WEB_IDENTITY_TOKEN_FILE. See also: | |
https://github.com/cognitect-labs/aws-api/blob/master/examples/assume_role_example.clj |
def validate_placeholder_refs(tree): | |
allowed = set([k for (k, v) in tree['template-set.json']['placeholders'].items()]) | |
def check_refs(placeholder): | |
for k, v in placeholder.items(): | |
if not k in allowed: | |
raise Invalid('no-such-placeholder', path=[k]) | |
return placeholder |
from abc import ABCMeta, abstractmethod | |
from collections import defaultdict | |
import json | |
import functools | |
class Validator(object): | |
__metaclass__ = ABCMeta | |
@abstractmethod |
(ns core | |
(:import (java.util Locale | |
Locale$Category | |
Locale$LanguageRange))) | |
(def configured-languages | |
[(Locale. "en") (Locale. "nl") (Locale. "en" "US") (Locale. "fil")]) | |
(def accept-languages | |
(Locale$LanguageRange/parse "fil,nl;q=0.8,en-GB;q=0.6,en;q=0.4,en-US;q=0.2")) |