-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hicetnunc2000
committed
Jan 3, 2021
0 parents
commit 878e4e0
Showing
1,557 changed files
with
104,558 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Distribution / packaging | ||
.Python | ||
*.pyc | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# Serverless directories | ||
.serverless |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:latest | ||
|
||
RUN pip install --upgrade pip | ||
|
||
RUN apt-get update | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
RUN pip install -r requirements.txt | ||
|
||
EXPOSE 5000 | ||
|
||
ENTRYPOINT ["python"] | ||
CMD ["app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# hesychasm | ||
|
||
https://l2qqvxozj5.execute-api.us-east-1.amazonaws.com/dev/ | ||
|
||
IPFS serverless infrastructure | ||
|
||
### docker build | ||
``` | ||
docker build -t ipfs-sls:latest . | ||
docker run -d -p 3000:3000 ipfs-sls | ||
curl --header "Content-Type: application/json" --request POST --data '{"data": {"title":"title","description":"description"}}' https://l2qqvxozj5.execute-api.us-east-1.amazonaws.com/dev/ipfs/post_json | ||
{"hash":"QmP4Azn85QGrBXxzVkNAfFPS2a7hkE4uTdWxBE4TDErs1F"} | ||
curl --header "Content-Type: application/json" --request POST --data '{"hash":"QmP4Azn85QGrBXxzVkNAfFPS2a7hkE4uTdWxBE4TDErs1F"}' https://l2qqvxozj5.execute-api.us-east-1.amazonaws.com/dev/ipfs/get_json | ||
{"data":{"title":"title","description":"description"}} | ||
curl -i -X POST -H "Content-Type: multipart/form-data" -F "[email protected]" https://l2qqvxozj5.execute-api.us-east-1.amazonaws.com/dev/ipfs/post_file | ||
{"hash":"QmT9SX2YFqitWQPxPzA1gEZxgJqBRZP1Zc5ZyStaBfY3UW"} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
from flask import Flask | ||
from flask_restx import Api | ||
from flask_cors import CORS, cross_origin | ||
|
||
# ROUTES | ||
|
||
from routes.ipfs import api as ipfs_api | ||
|
||
app = Flask(__name__) | ||
|
||
cors = CORS(app, supports_credentials=True) | ||
|
||
api = Api() | ||
api = Api(version = 'v1.0.0', | ||
title = 'hesychasm', | ||
description= 'A serverless API for managing IPFS Content Identifiers (CIDs)', | ||
contact='[email protected]') | ||
|
||
# NAMESPACES | ||
|
||
api.add_namespace(ipfs_api) | ||
|
||
api.init_app(app) | ||
|
||
if __name__ == '__main__': | ||
app.run(debug=True, host='0.0.0.0', port=5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import json | ||
|
||
# Validate different possible ways of Sessions concerning key's configurations | ||
# and Requests that can be presented by users | ||
|
||
class Validate(): | ||
def __init__(self): | ||
pass | ||
|
||
# interpret requests in it's possible formats | ||
# returns a json with requested data | ||
|
||
def read_requests(self, request): | ||
if (request.data.__len__() == 0): | ||
return request.args.to_dict(flat=True) | ||
else: | ||
return json.loads(request.data) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.