我在第一天工作的3000端口的ec2实例上部署了一个featherjs后端。但是稍后当我尝试访问它时,没有服务打开。但是,如果我尝试键入未注册为服务的任何内容,则会显示“ 404页面未找到”,这表明feathersjs正在运行,但是当我尝试将3000 / cards作为服务时,它将永久加载并返回“此页面”无效”在本地,一切正常。我不知道在AWS EC2实例上托管后出了什么问题。
const publications = require('./publications/publications.service.js');
const cards = require('./cards/cards.service.js');
const uploads = require('./uploads/uploads.service.js');
const providers = require('./providers/providers.service.js');
// eslint-disable-next-line no-unused-vars
module.exports = function(app) {
app.configure(publications);
app.configure(cards);
app.configure(uploads);
app.configure(providers);
};
示例服务
// Initializes the `providers` service on path `/providers`
const createService = require('feathers-mongoose');
const createModel = require('../../models/providers.model');
const hooks = require('./providers.hooks');
module.exports = function (app) {
const Model = createModel(app);
const paginate = app.get('paginate');
const options = {
Model
//paginate
};
// Initialize our service with any options it requires
app.use('/providers', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('providers');
service.hooks(hooks);
};
预期结果是加载JSON文件或显示[]表示文件为空