Skip to content

Commit 14a8e0a

Browse files
committed
Initial commit
0 parents  commit 14a8e0a

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Keith Galli
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# sentiment-api

main_template.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from flask import Flask, jsonify, request
2+
from flask_restful import Api, Resource
3+
from flasgger import Swagger
4+
5+
app = Flask(__name__)
6+
api = Api(app)
7+
swagger = Swagger(app)
8+
9+
class UppercaseText(Resource):
10+
11+
def get(self):
12+
"""
13+
This method responds to the GET request for this endpoint and returns the data in uppercase.
14+
---
15+
tags:
16+
- Text Processing
17+
parameters:
18+
- name: text
19+
in: query
20+
type: string
21+
required: true
22+
description: The text to be converted to uppercase
23+
responses:
24+
200:
25+
description: A successful GET request
26+
content:
27+
application/json:
28+
schema:
29+
type: object
30+
properties:
31+
text:
32+
type: string
33+
description: The text in uppercase
34+
"""
35+
text = request.args.get('text')
36+
37+
return jsonify({"text": text.upper()})
38+
39+
api.add_resource(UppercaseText, "/uppercase")
40+
41+
if __name__ == "__main__":
42+
app.run(debug=True)

0 commit comments

Comments
 (0)