A more clever way to get the static dirs
This commit is contained in:
parent
6ff1552063
commit
6ad7f85e76
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -63,8 +64,9 @@ class HttpBackend(Backend):
|
||||||
|
|
||||||
|
|
||||||
def webserver(self):
|
def webserver(self):
|
||||||
template_dir = os.path.join(os.getcwd(),'platypush','backend','http','templates')
|
basedir = os.path.dirname(inspect.getfile(self.__class__))
|
||||||
static_dir = os.path.join(os.getcwd(),'platypush','backend','http','static')
|
template_dir = os.path.join(basedir, 'templates')
|
||||||
|
static_dir = os.path.join(basedir, 'static')
|
||||||
app = Flask(__name__, template_folder=template_dir)
|
app = Flask(__name__, template_folder=template_dir)
|
||||||
|
|
||||||
@app.route('/execute', methods=['POST'])
|
@app.route('/execute', methods=['POST'])
|
||||||
|
|
Loading…
Reference in a new issue