A semantic search engine for source code https://bitshift.benkurtovic.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
629 B

  1. """
  2. Module to contain all the project's Flask server plumbing.
  3. """
  4. from flask import Flask
  5. from flask import render_template, session
  6. from bitshift.database import Database
  7. from bitshift.query import parse_query
  8. app = Flask(__name__)
  9. app.config.from_object("bitshift.config")
  10. app_env = app.jinja_env
  11. app_env.line_statement_prefix = "="
  12. app_env.globals.update(assets=assets)
  13. database = Database()
  14. @app.route("/")
  15. def index():
  16. return render_template("index.html")
  17. @app.route("/search/<query>")
  18. def search(query):
  19. tree = parse_query(query)
  20. database.search(tree)
  21. pass
  22. if __name__ == "__main__":
  23. app.run()