我有通过sequelize使用mysql运行的feathers.js.这是有效的,我可以从表中收集数据.下一步是在模型中定义"连接".
我有一个表'status_id'和'country_id'的表.这些列引用元数据表中的id.在SQL中我会说:
SELECT status.description, country.description, detail
FROM details
INNER JOIN metadata status
ON (details.status_id = status.id AND status.type = 'status'
INNER JOIN metadata country
ON (details.country_id =country.id AND country.type = 'country')
Run Code Online (Sandbox Code Playgroud)
在这种情况下,此元数据表不会很大,因此这种方法.它确实提供了我需要的灵活性.
在feathters.js中我需要做什么?
我有一个用featherjs制作的应用程序,希望与https一起运行。我已经开始工作了。我通过将'index.js'文件更改为如下形式来做到这一点:
const fs = require('fs');
const https = require('https');
const app = require('./app');
const port = app.get('port');
const host = app.get('host');
//const server = app.listen(port);
const server = https.createServer({
key: fs.readFileSync('./certs/aex007.key'),
cert: fs.readFileSync('./certs/aex007.crt')
}, app).listen(port, function(){
console.log("Mfp Backend started: https://" + host + ":" + port);
});
Run Code Online (Sandbox Code Playgroud)
现在,我进入邮递员中的“ https://127.0.0.1/a_service_name ”,接受证书后就得到了结果。当我在浏览器中转到该地址时,它还会给出结果,证书指示为“红色”,因为它是自签名的。
所以我的问题是以下。当我在浏览器中转到“ http://127.0.01 ”时,我没有得到“套接字”信息,而没有得到“ index.html”文件,只有空白页。我在控制台中收到以下错误
信息:(404)路线:/socket.io/?EIO=3&transport=polling&t=LwydYAw-找不到页面
然后,我正在使用的“ index.html”文件当前包含以下内容:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
<script type="text/javascript" src="//cdn.rawgit.com/feathersjs/feathers-client/v1.1.0/dist/feathers.js"></script>
<script type="text/javascript">
var socket = io('https://127.0.0.1:3001');
var client = feathers()
.configure(feathers.hooks())
.configure(feathers.socketio(socket));
var todoService = client.service('/some_service');
todoService.on('created', …Run Code Online (Sandbox Code Playgroud) 我有一个带有羽毛的 nuxt.js 项目。客户端和服务器是不同的实体,你单独启动它们。客户端使用 nuxt.js。我想配置生产和开发设置。
目前我的 nuxt.config.js 看起来像这样:
module.exports = {
head: {
title: "SITE TITLE"
},
env: {
backendUrl: 'http://localhost:3001'
}
};
Run Code Online (Sandbox Code Playgroud)
我想要的是,如果我使用“npm run dev”开发设置启动客户端。我想要例如不同的标头和不同的 backendUrl。
题
我需要做什么来实现这一点?