@GELight wrote:
Hi all,
I search an example where I can define REST Ressources ( GET, POST, … ) in a simple in-repo-addon for the development time until I have a real node project for my backend etc…
I created my in-repo-addon by ember-cli. This is my addon package.json - ( its a copy of an running example from another project )::
{ "name": "test-backend", "keywords": [ "ember-addon" ], "ember-addon": { "before": [ "serve-files-middleware", "history-support-middleware", "proxy-server-middleware" ] } }
… and this is my Test-Server with my first Ressource:
/* eslint-env node */ 'use strict'; module.exports = { name: 'test-backend', isDevelopingAddon() { return true; }, serverMiddleware({app}) { console.log('init test backend - /api - v1.0'); app.get('/activities', (req, res) => { console.log(req.params); }); } };
If I start my server there are no errors in my log. But my application is stopping with
GET http://localhost:4200/api/activities 404 (Not Found)
I do not know what is wrong…
No help found in documentation or google too…
Best regards, Mario
Posts: 2
Participants: 2