adding some initial hooks to the JavaScript
This commit is contained in:
Родитель
3028cf0fce
Коммит
1799e9b650
|
@ -1,4 +1,4 @@
|
|||
syntax: glob
|
||||
|
||||
*.pyc
|
||||
|
||||
narwhal
|
||||
|
|
|
@ -33,6 +33,7 @@ from hashlib import sha256
|
|||
|
||||
from urlrelay import URLRelay, register
|
||||
from paste.auth import auth_tkt
|
||||
from paste.proxy import Proxy
|
||||
import simplejson
|
||||
import tempfile
|
||||
from webob import Request, Response
|
||||
|
@ -1174,6 +1175,9 @@ def make_app():
|
|||
register("^/docs/code/", code_app)
|
||||
register("^/docs/", docs_app)
|
||||
|
||||
proxy_app = Proxy("http://localhost:8081/")
|
||||
register("^/.js/", proxy_app)
|
||||
|
||||
for location, directory in c.static_map.items():
|
||||
topop = 1 + location.count('/')
|
||||
more_static = pathpopper_middleware(static.Cling(directory), topop)
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
var server = require("narwhal/server");
|
||||
var sprintf = require("printf").sprintf;
|
||||
var Jack = require("jack");
|
||||
var Path = require("file").Path;
|
||||
var system = require("system");
|
||||
|
||||
exports.app = function(env) {
|
||||
var page = sprintf("<html><head><script>%s</script></head><body>Hi <script></script></body></html>", env.script.require("hello"));
|
||||
return {
|
||||
status : 200,
|
||||
headers : { "Content-Type" : "text/html", "Content-Length" : String(page.length) },
|
||||
body : [page]
|
||||
};
|
||||
};
|
||||
|
||||
var options = {debug:true};
|
||||
|
||||
exports.app = Jack.ShowExceptions(server.App(exports.app, options));
|
||||
|
|
@ -90,8 +90,7 @@ def start():
|
|||
|
||||
config.set_profile('dev')
|
||||
|
||||
if options.server.try_build:
|
||||
config.c.static_dir = (options.build_dir / "frontend").abspath()
|
||||
config.c.static_dir = path(options.clientdir) / "src" / "html"
|
||||
|
||||
if options.server.dburl:
|
||||
config.c.dburl = options.server.dburl
|
||||
|
|
Загрузка…
Ссылка в новой задаче