Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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.

spa.js 316B

12345678910111213
  1. // Single Page Apps - redirect to /#/
  2. module.exports = function(req, res, next) {
  3. if (req.method !== "GET" && req.method !== "HEAD")
  4. next();
  5. if (req.url !== '/') {
  6. var route = req.url;
  7. req.url = '/';
  8. res.statusCode = 302;
  9. res.setHeader('Location', req.url + '#' + route);
  10. res.end();
  11. }
  12. else next();
  13. }