Skip to content

Commit

Permalink
Fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
AronBuzogany committed Feb 23, 2024
1 parent bd8858c commit 7dec852
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
4 changes: 2 additions & 2 deletions backend/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
This file is the base of the Flask API. It contains the basic structure of the API.
"""

from flask import Flask, jsonify
from .endpoints.index import index_bp
from flask import Flask
from .endpoints.index.index import index_bp

def create_app():
"""
Expand Down
10 changes: 0 additions & 10 deletions backend/project/endpoints/index.py

This file was deleted.

45 changes: 45 additions & 0 deletions backend/project/endpoints/index/OpenAPI_Object.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"openapi": "3.1.0",
"info": {
"title": "Pigeonhole API",
"summary": "A project submission and grading API for University Ghent students and professors.",
"description": "The API built for the Pigeonhole application. It serves as an interface for student of University Ghent. They can submit solutions to projects created by their professors. Professors and their assistents can then review these submitions, grade them and define custom tests that automatically run on every submition. The API is built using the OpenAPI 3.1.0 specification.",
"version": "1.0.0",
"contact": {
"name": "Project discussion forum",
"url": "https://github.com/SELab-2/UGent-opgave/discussions",
"email": "Bart.Coppens@UGent.be"
},
"x-authors": [
{
"name": "Aron Buzogany",
"github": "https://github.com/AronBuzogany"
},
{
"name": "Gerwoud Van den Eynden",
"github": "https://github.com/Gerwoud"
},
{
"name": "Jarne Clauw",
"github": "https://github.com/JarneClauw"
},
{
"name": "Siebe Vlietinck",
"github": "https://github.com/Vucis"
},
{
"name": "Warre Provoost",
"github": "https://github.com/warreprovoost"
},
{
"name": "Cedric Mekeirle",
"github": "https://github.com/JibrilExe"
},
{
"name": "Matisse Sulzer",
"github": "https://github.com/Matisse-Sulzer"
}
]
},
"paths": []
}
13 changes: 13 additions & 0 deletions backend/project/endpoints/index/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from flask import Blueprint, send_from_directory
from flask_restful import Resource, Api
import os

index_bp = Blueprint("index", __name__)
index_endpoint = Api(index_bp)

class Index(Resource):
def get(self):
dir_path = os.path.dirname(os.path.realpath(__file__))
return send_from_directory(dir_path, "OpenAPI_Object.json")

index_bp.add_url_rule("/", view_func=Index.as_view("index"))

0 comments on commit 7dec852

Please sign in to comment.