Esempio n. 1
0
 def api(self):
     """API Endpoint with CORS and JSON response
 This is using docstrings for specifications.
 ---
 definitions:
   Endpoint:
     type: object
     properties:
       date:
         type: date
       description:
         type: string
     items:
     $ref: '#/definitions/Endpoint'
 responses:
   200:
     description: API Endpoint with CORS and JSON response
     schema:
       $ref: '#/definitions/Endpoint'
     examples:
       response: {
           "date": "2019-11-29T18:28:07.125075+00:00",
           "description": "API Endpoint with CORS and JSON response"
       }
 """
     return {
         "date": date.utcnow(),
         "description": "API Endpoint with CORS and JSON response"
     }
Esempio n. 2
0
 def cached(self):
     return {
         "description": "This is a cached endpoint",
         "date": date.utcnow(),
     }
Esempio n. 3
0
 def api(self):
     return {
         "date": date.utcnow(),
         "description": "API Endpoint with CORS and JSON response"
     }
Esempio n. 4
0
 def cached(self):
     return {"date": date.utcnow()}
Esempio n. 5
0
 def api(self):
     return {"date": date.utcnow()}