blockchain-access-control

git clone git://git.codymlewis.com/blockchain-access-control.git
Log | Files | Refs | README

Server.py (338B)


      1 #!/usr/bin/env python3
      2 # -*- coding: utf-8 -*-
      3 
      4 '''
      5 A simple flask server that gives some random sensor like data
      6 '''
      7 
      8 import random
      9 
     10 from flask import Flask
     11 
     12 APP = Flask(__name__)
     13 
     14 @APP.route("/data")
     15 def data():
     16     return f"{random.randint(0, 20)}ms", 200
     17 
     18 @APP.route("/add")
     19 def add():
     20     return f"You may now access this data", 200