Frontend/Bootstrap/專業/main.py

37 lines
675 B
Python
Raw Normal View History

2024-04-23 16:21:37 +08:00
from flask import Flask
from flask import render_template
from flask import Flask, request, jsonify
import threading
import requests, socket
import pymysql
# from flask_cors import CORS
class Website(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.app = Flask(__name__)
# CORS(self.app)
#前端顯示
self.app.add_url_rule('/', 'Index', self.Index)
def run(self):
#self.app.run()
self.app.run(host="0.0.0.0", port="5510")
# 前端
def Index(self):
return render_template('Index.html')
if __name__ == '__main__':
website = Website()
website.run()