Herick1 commited on
Commit
3de94d7
1 Parent(s): c483580

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, request
2
+ import sqlite3
3
+
4
+ app = Flask(__name__)
5
+
6
+ @app.route('/', methods=["GET","POST"])
7
+ def get_data():
8
+ message = "ERRO"
9
+
10
+ try:
11
+
12
+ conn = sqlite3.connect("govDatabase3.db")
13
+ sql_query = """INSERT INTO CNAES (`CÓDIGO`, `DESCRIÇÃO`) VALUES (10, "descrição 1");"""
14
+ cursor = conn.execute(sql_query)
15
+ cursor.fetchall()
16
+
17
+ message = "CERTO!"
18
+
19
+ except: pass
20
+
21
+
22
+ return {"message": message}