ni-c / heimcontrol.js

Home-Automation with node.js and Raspberry PI
MIT License
1.41k stars 297 forks source link

Webcam via Motion shows only iframe with 404 inside #110

Open lichtteil opened 9 years ago

lichtteil commented 9 years ago

I tried to set up a webcam using 'motion'. The settings are straight forward but on the home screen the content of the webcam stream iframe only shows a 404-error produced by heimcontrol.

The source of the iframe is /webcam/motion/some-id-of-webcam. Trying to open that also results in 404-error-page.

I found out that the error page is shown before the router shows the webcam-plugin's content. My solution was use another way to handle 404s. In https://github.com/ni-c/heimcontrol.js/blob/master/heimcontrol.js#L174 I replaced

app.get('plugin helper').getPluginList(function(err, plugins) {
        app.locals.plugins = plugins;
        app.set('plugins', plugins);

        // 404 Not found
        app.all('*', Routes.notFound);

      });

by

 app.get('plugin helper').getPluginList(function(err, plugins) {
        app.locals.plugins = plugins;
        app.set('plugins', plugins);
      });

      // 404 Not found
      app.use(Routes.notFound);

Can anyone confirm that issue and also the solution? Cheers!

Gagnon06 commented 9 years ago

Thanks! Working now on Safari!