forked from digitalocean/sample-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
46 lines (41 loc) · 1.42 KB
/
server.py
File metadata and controls
46 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from flask import Flask
# import pymongo
# from bson.json_util import dumps, loads
# from flask_cors import CORS
app = Flask(__name__)
# myclient = pymongo.MongoClient(
# "mongodb://fre:[email protected]:27017,cluster0-shard-00-01.7xkdf.mongodb.net:27017,cluster0-shard-00-02.7xkdf.mongodb.net:27017/myFirstDatabase?ssl=true&replicaSet=atlas-11kjk0-shard-0&authSource=admin&retryWrites=true&w=majority")
# mydb = myclient["mydatabase"]
# mycol = mydb["News"]
# mycolAbiy = mydb["abiyahmadali"]
# mycolTikvah = mydb["tikvah"]
# mycolBisrat = mydb["BisratSport"]
# mycolEbc = mydb["ebc"]
#
#
# @app.route('/news', methods=['GET'])
# def get_all_stars():
# return dumps(list(mycol.find().limit(50)), indent=2)
#
#
# @app.route('/news/telegram/tikvah', methods=['GET'])
# def get_all_telegram_tikvah():
# return dumps(list(mycolTikvah.find().limit(20)), indent=2)
#
#
# @app.route('/news/telegram/ebc', methods=['GET'])
# def get_all_telegram_ebc():
# return dumps(list(mycolEbc.find().limit(20)), indent=2)
#
#
# @app.route('/news/telegram/bisratsport', methods=['GET'])
# def get_all_telegram_bisratsport():
# return dumps(list(mycolBisrat.find().limit(20)), indent=2)
#
#
# @app.route('/news/twitter/abiyahmadali', methods=['GET'])
# def get_all_twitter():
# return dumps(list(mycolAbiy.find().limit(20)), indent=2)
@app.route('/', methods=['GET'])
def welcome():
return "welcome to our api"