繁体   English   中英

socketstream 应用程序抛出 404 未找到

[英]socketstream app throwing 404 not found

我正在尝试使用 express 和 cors 加载 socketstream 应用程序,这引发了一个错误,指出 404。所有项目目录在浏览器中都可用,但没有内容。

var app = require('express')();
var ss = require('socketstream');
var cors = require('cors');

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

app.use(cors());


app.get('/', function(req, res) {
 res.serve('main');
});

ss.start(app.listen(port));

这是浏览器中的响应

标题

Remote Address:"RemoteAddress":"Port"
Request URL:http://"RemoteAddress":"Port"/_serveDev/code/app/someFile.js?ts=1449057700740&pathPrefix=app
Request Method:GET
Status Code:404 Not Found

请求头

Connection:keep-alive
Content-Length:76
Content-Type:text/html; charset=utf-8
Date:Wed, 02 Dec 2015 12:03:20 GMT
X-Content-Type-Options:nosniff
X-Powered-By:Express

响应头

Accept:*/*
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:"RemoteAddress":"Port"
Referer:http://"RemoteAddress":"Port"/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

更新

app.html 正在浏览器中加载,但 404 仅适用于从 app.html 请求的脚本和 css。

谢谢。

尝试通过运行更改文件的权限

sudo chmod 777 -R * 

在代码目录中。

暂无
暂无

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

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