Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

express-app.js 705B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. var path = require('path');
  3. module.exports = function express(env, app) {
  4. function NunjucksView(name, opts) {
  5. this.name = name;
  6. this.path = name;
  7. this.defaultEngine = opts.defaultEngine;
  8. this.ext = path.extname(name);
  9. if (!this.ext && !this.defaultEngine) {
  10. throw new Error('No default engine was specified and no extension was provided.');
  11. }
  12. if (!this.ext) {
  13. this.name += this.ext = (this.defaultEngine[0] !== '.' ? '.' : '') + this.defaultEngine;
  14. }
  15. }
  16. NunjucksView.prototype.render = function render(opts, cb) {
  17. env.render(this.name, opts, cb);
  18. };
  19. app.set('view', NunjucksView);
  20. app.set('nunjucksEnv', env);
  21. return env;
  22. };