I've just finished my application which uses Ember.js as a frontend framework, Node.js for my REST API and MongoDB as the default database. I'm trying to deploy the application to Heroku, but it doesn't seem to work properly. I have my Ember code in the folder ember-store and my API in ember-store/store-api. The app is deployed, but not functional when I open it up, Heroku gives me the following error: "An error occurred in the application and your page could not be served."
My node.js code looks like this:
const http = require('http'); // Import http package
const app = require('./app'); // Import app.js file from current directory
const port = process.env.PORT || 3000;
const server = http.createServer(app);
server.listen(port);
In my Ember application, I have the following adapters:
adapters/application.js
import RESTAdapter from '@ember-data/adapter/rest';
export default RESTAdapter.extend({
namespace: 'api',
host: 'http://localhost:3000'
});
adapters/order.js
import RESTAdapter from '@ember-data/adapter/rest';
export default RESTAdapter.extend({
host: "http://localhost:3000",
});
adapters/product.js
import RESTAdapter from '@ember-data/adapter/rest';
export default RESTAdapter.extend({
urlForFindAll() {
return 'http://localhost:3000/products';
},
});
I'm assuming I need to replace 'localhost:3000' in my adapters, but I don't think it's gonna resolve the issue. Is there a guide on how can I deploy it to Heroku(or anywhere else)? Any help would be greatly appreciated!
Aucun commentaire:
Enregistrer un commentaire