diff --git a/commons/db/create.sql b/commons/db/create.sql new file mode 100644 index 0000000..6c700a2 --- /dev/null +++ b/commons/db/create.sql @@ -0,0 +1 @@ +create database `duzz-pedidos`; \ No newline at end of file diff --git a/commons/db/create_tables.sql b/commons/db/create_tables.sql new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b535013 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +flask +flask_restful +flask_cors \ No newline at end of file diff --git a/resources/__init__.py b/resources/__init__.py new file mode 100644 index 0000000..808dd74 --- /dev/null +++ b/resources/__init__.py @@ -0,0 +1 @@ +from resources.pedidos import Pedidos \ No newline at end of file diff --git a/resources/pedidos/__init__.py b/resources/pedidos/__init__.py new file mode 100644 index 0000000..a73851a --- /dev/null +++ b/resources/pedidos/__init__.py @@ -0,0 +1,19 @@ +from flask_restful import Resource + +class Pedidos(Resource): + def get(self): + return { + 'codigo': 1 + } + + + def put(self): + pass + + + def post(self): + pass + + + def delete(self): + pass \ No newline at end of file diff --git a/server.py b/server.py new file mode 100644 index 0000000..3c2bd60 --- /dev/null +++ b/server.py @@ -0,0 +1,24 @@ +from logging import debug +from flask import Flask +from flask_restful import Api +from flask_cors import CORS + +from resources import ( + Pedidos +) + +app = Flask(__name__) +CORS(app) +api = Api(app) + + +@app.route('/') +def index(): + return """ +