Skip to content

Commit

Permalink
Moved the Recon-web UI route to the app level and renamed the views.p…
Browse files Browse the repository at this point in the history
…y file to api.py to reflect the nature of its content.
  • Loading branch information
lanmaster53 committed Oct 27, 2019
1 parent 2d1e0f4 commit ec96b94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
11 changes: 6 additions & 5 deletions recon/core/web/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from flask import Flask, request, abort, cli
from flask import Flask, cli, render_template
from flasgger import Swagger
from recon.core import base
from recon.core.constants import BANNER_WEB
from recon.core.web.db import Tasks
from redis import Redis
import os
import rq

# disable the development server warning banner
Expand Down Expand Up @@ -51,9 +50,11 @@ def disable_cache(response):
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
return response

from recon.core.web.views import core
app.register_blueprint(core)
from recon.core.web.views import resources
@app.route('/')
def index():
return render_template('index.html', workspaces=recon._get_workspaces())

from recon.core.web.api import resources
app.register_blueprint(resources)

return app
8 changes: 1 addition & 7 deletions recon/core/web/views.py → recon/core/web/api.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from flask import Blueprint, current_app, render_template, request, abort
from flask import Blueprint, current_app, request, abort
from flask_restful import Resource, Api
from recon.core.web import recon, tasks
from recon.core.web.utils import columnize
from recon.core.web.constants import EXPORTS, REPORTS

core = Blueprint('core', __name__)

@core.route('/')
def index():
return render_template('index.html', workspaces=recon._get_workspaces())

resources = Blueprint('resources', __name__, url_prefix='/api')
api = Api()
api.init_app(resources)
Expand Down
2 changes: 1 addition & 1 deletion recon/core/web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<select id="template">
<option id="templateOption"></option>
</select>
<a href="{{ url_for('core.index') }}">[recon-ng]</a>
<a href="{{ url_for('index') }}">[recon-ng]</a>
<span>[</span>
<select id="workspace">
{% for workspace in workspaces %}
Expand Down

0 comments on commit ec96b94

Please sign in to comment.