-
Notifications
You must be signed in to change notification settings - Fork 6
/
app.py
22 lines (16 loc) · 917 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from flask import Flask,jsonify
import requests
from data import getdata
app = Flask(__name__)
app.url_map.strict_slashes = False
@app.route("/")
def home():
x={"all":"https://inshorts-news.vercel.app/all","national":"https://inshorts-news.vercel.app/national","business":"https://inshorts-news.vercel.app/business","sports":"https://inshorts-news.vercel.app/sports","world":"https://inshorts-news.vercel.app/world","politics":"https://inshorts-news.vercel.app/politics","technology":"https://inshorts-news.vercel.app/technology","startup":"https://inshorts-news.vercel.app/startup","entertainment":"https://inshorts-news.vercel.app/entertainment","science":"https://inshorts-news.vercel.app/science","automobile":"https://inshorts-news.vercel.app/automobile"}
return x
@app.route("/<string>")
def nat(string):
x=getdata(string)
return x
if __name__ == "__main__":
#app.debug = True
app.run()