简体   繁体   English

套接字流未加载客户端库

[英]Socketstream not loading client libraries

I'm just getting started with socketstream. 我刚刚开始使用socketstream。 I tried to create a hello world app: 我试图创建一个hello world应用程序:

var http = require('http'),
ss = require('socketstream');

ss.client.define('main', {
    view: 'app.html',
    css: ['libs'],
    code: ['app','libs'],
    tmpl: '*'});

ss.http.route('/',function(req, res) {
        res.serveClient('main');
    });

var server = http.Server(ss.http.middleware);
server.listen(3000);

ss.start(server);

It seems to load ok, but any of the libraries I put in client/code/libs doesn't seem to be pushed to the browser. 似乎可以正常加载,但是我放在client / code / libs中的任何库似乎都没有推送到浏览器。

For example, I put underscore.js in client/code/libs with a very simple html file in client/views, and all I get is: 例如,我将underscore.js放在客户端/代码/库中,在客户端/视图中带有一个非常简单的html文件,我得到的是:

<html>
<head></head>
<body>
    bwahahahahahaha
</body>
</html>

Why is not loading/injecting the client libraries? 为什么不加载/注入客户端库?

> >

这里的问题是要确保您的html页面的头部包含<socketstream />标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM