services.py 466 B

123456789101112131415161718192021222324
  1. from flask import Flask, request
  2. import os
  3. app = Flask(__name__)
  4. @app.route('/')
  5. def hello_world():
  6. return 'Hello World'
  7. @app.route('/newProject')
  8. def new_project():
  9. name = request.args.get('name')
  10. os.system("mkdir "+name)
  11. os.system("cd "+name+" && mkdir nodesets")
  12. return 'New project folder created.'
  13. @app.route('/loadNew')
  14. def new_project():
  15. name = request.args.get('name')
  16. return 'New nodeset(s) loaded.'
  17. if __name__ == '__main__':
  18. app.run()