├── .editorconfig ├── .gitignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── appveyor.yml ├── gulpfile.js ├── lib └── index.js ├── misc ├── timeline_precomposed.png └── timeline_regular.png ├── package.json └── test ├── fixtures ├── init │ ├── compose.js │ ├── index.htmlt │ ├── sub1 │ │ ├── compose.js │ │ ├── index.htmlt │ │ └── subsub1 │ │ │ ├── compose.js │ │ │ └── index.htmlt │ ├── sub2 │ │ └── index.htmlt │ └── sub3 │ │ └── compose.js ├── invalid │ ├── compose-error │ │ ├── compose.js │ │ └── index.htmlt │ ├── compose-export │ │ ├── compose.js │ │ └── index.htmlt │ ├── no-templates │ │ ├── compose │ │ │ └── compose.js │ │ ├── sub1 │ │ │ └── test.json │ │ └── test.json │ └── rendering-error │ │ └── index.htmlt ├── separate-root-no-index-fallback-html │ ├── _root │ │ └── static.txt │ └── index.html ├── separate-root-no-index-fallback-htmlt │ ├── _root │ │ └── static.txt │ ├── compose.js │ └── index.htmlt ├── separate-root-no-index │ └── _root │ │ └── static.txt ├── separate-root-static │ ├── _root │ │ └── index.html │ ├── index.html │ └── spa │ │ ├── compose.js │ │ └── index.htmlt ├── separate-root │ ├── _root │ │ ├── compose.js │ │ ├── existsAtSeparateRootAndRealRoot.txt │ │ ├── folder │ │ │ ├── index.html │ │ │ └── static.txt │ │ ├── index.htmlt │ │ ├── root-spa │ │ │ ├── compose.js │ │ │ ├── folder │ │ │ │ └── static.txt │ │ │ ├── index.htmlt │ │ │ └── static.txt │ │ ├── spa │ │ │ └── existsAtSeparateRootAndSpa.txt │ │ └── static.txt │ ├── compose.js │ ├── existsAtSeparateRootAndRealRoot.txt │ ├── folder │ │ ├── index.html │ │ └── static.txt │ ├── index.htmlt │ ├── spa │ │ ├── compose.js │ │ ├── existsAtSeparateRootAndSpa.txt │ │ ├── folder │ │ │ └── static.txt │ │ ├── index.htmlt │ │ └── static.txt │ └── static.txt ├── serve-no-pushstate │ ├── beforeAll-hook │ │ ├── compose.js │ │ └── index.htmlt │ └── index.html └── serve │ ├── async-compose │ ├── compose.js │ └── index.htmlt │ ├── compose-with-router │ ├── compose.js │ └── index.htmlt │ ├── compose.js │ ├── head │ ├── not-supported │ │ ├── compose.js │ │ └── index.htmlt │ └── supported │ │ ├── compose.js │ │ └── index.htmlt │ ├── index.htmlt │ ├── regular.html │ ├── sub1 │ ├── index.htmlt │ └── test.json │ ├── test │ ├── test.json │ ├── tmpl-settings │ └── index.htmlt │ ├── with-compose │ ├── compose.js │ └── index.htmlt │ └── without-compose │ └── index.htmlt └── spec ├── beforeAll-hook.js ├── compose-error.js ├── express-router.js ├── head-and-other-verbs.js ├── init.js ├── multiple-root-paths.js ├── no-templates.js ├── pushstate.js ├── render.js ├── rendering-error.js ├── serve-static.js ├── static-settings.js └── tmpl-settings.js /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/.editorconfig -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | coverage 3 | node_modules -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/.jshintrc -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/.npmignore -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/.travis.yml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/README.md -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/appveyor.yml -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/gulpfile.js -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/lib/index.js -------------------------------------------------------------------------------- /misc/timeline_precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/misc/timeline_precomposed.png -------------------------------------------------------------------------------- /misc/timeline_regular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/misc/timeline_regular.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/package.json -------------------------------------------------------------------------------- /test/fixtures/init/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/init/compose.js -------------------------------------------------------------------------------- /test/fixtures/init/index.htmlt: -------------------------------------------------------------------------------- 1 | root -------------------------------------------------------------------------------- /test/fixtures/init/sub1/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/init/sub1/compose.js -------------------------------------------------------------------------------- /test/fixtures/init/sub1/index.htmlt: -------------------------------------------------------------------------------- 1 | sub1 -------------------------------------------------------------------------------- /test/fixtures/init/sub1/subsub1/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/init/sub1/subsub1/compose.js -------------------------------------------------------------------------------- /test/fixtures/init/sub1/subsub1/index.htmlt: -------------------------------------------------------------------------------- 1 | subsub1 -------------------------------------------------------------------------------- /test/fixtures/init/sub2/index.htmlt: -------------------------------------------------------------------------------- 1 | sub2 -------------------------------------------------------------------------------- /test/fixtures/init/sub3/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/init/sub3/compose.js -------------------------------------------------------------------------------- /test/fixtures/invalid/compose-error/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/invalid/compose-error/compose.js -------------------------------------------------------------------------------- /test/fixtures/invalid/compose-error/index.htmlt: -------------------------------------------------------------------------------- 1 | root -------------------------------------------------------------------------------- /test/fixtures/invalid/compose-export/compose.js: -------------------------------------------------------------------------------- 1 | exports.loc = 'invalid'; -------------------------------------------------------------------------------- /test/fixtures/invalid/compose-export/index.htmlt: -------------------------------------------------------------------------------- 1 | root -------------------------------------------------------------------------------- /test/fixtures/invalid/no-templates/compose/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/invalid/no-templates/compose/compose.js -------------------------------------------------------------------------------- /test/fixtures/invalid/no-templates/sub1/test.json: -------------------------------------------------------------------------------- 1 | { "loc": "sub1" } -------------------------------------------------------------------------------- /test/fixtures/invalid/no-templates/test.json: -------------------------------------------------------------------------------- 1 | { "loc": "root" } -------------------------------------------------------------------------------- /test/fixtures/invalid/rendering-error/index.htmlt: -------------------------------------------------------------------------------- 1 | <%= notDefined %> -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index-fallback-html/_root/static.txt: -------------------------------------------------------------------------------- 1 | static.txt - separate-root-no-index-fallback-html/_root -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index-fallback-html/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-no-index-fallback-html/index.html -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index-fallback-htmlt/_root/static.txt: -------------------------------------------------------------------------------- 1 | static.txt - separate-root-no-index-fallback-htmlt/_root -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index-fallback-htmlt/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-no-index-fallback-htmlt/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index-fallback-htmlt/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> -------------------------------------------------------------------------------- /test/fixtures/separate-root-no-index/_root/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-no-index/_root/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root-static/_root/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-static/_root/index.html -------------------------------------------------------------------------------- /test/fixtures/separate-root-static/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-static/index.html -------------------------------------------------------------------------------- /test/fixtures/separate-root-static/spa/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root-static/spa/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root-static/spa/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/existsAtSeparateRootAndRealRoot.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/existsAtSeparateRootAndRealRoot.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/folder/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/folder/index.html -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/folder/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/folder/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/root-spa/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/root-spa/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/root-spa/folder/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/root-spa/folder/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/root-spa/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/root-spa/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/root-spa/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/spa/existsAtSeparateRootAndSpa.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/spa/existsAtSeparateRootAndSpa.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/_root/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/_root/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root/existsAtSeparateRootAndRealRoot.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/existsAtSeparateRootAndRealRoot.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/folder/index.html: -------------------------------------------------------------------------------- 1 | index.html - separate-root/folder - should be overwritten -------------------------------------------------------------------------------- /test/fixtures/separate-root/folder/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/folder/static.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> - should be overwritten -------------------------------------------------------------------------------- /test/fixtures/separate-root/spa/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/spa/compose.js -------------------------------------------------------------------------------- /test/fixtures/separate-root/spa/existsAtSeparateRootAndSpa.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/spa/existsAtSeparateRootAndSpa.txt -------------------------------------------------------------------------------- /test/fixtures/separate-root/spa/folder/static.txt: -------------------------------------------------------------------------------- 1 | static.txt - separate-root/spa/folder -------------------------------------------------------------------------------- /test/fixtures/separate-root/spa/index.htmlt: -------------------------------------------------------------------------------- 1 | index.htmlt - <%= req.localpath %> -------------------------------------------------------------------------------- /test/fixtures/separate-root/spa/static.txt: -------------------------------------------------------------------------------- 1 | static.txt - separate-root/spa -------------------------------------------------------------------------------- /test/fixtures/separate-root/static.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/separate-root/static.txt -------------------------------------------------------------------------------- /test/fixtures/serve-no-pushstate/beforeAll-hook/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve-no-pushstate/beforeAll-hook/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve-no-pushstate/beforeAll-hook/index.htmlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve-no-pushstate/beforeAll-hook/index.htmlt -------------------------------------------------------------------------------- /test/fixtures/serve-no-pushstate/index.html: -------------------------------------------------------------------------------- 1 | not loaded for pushstate urls 2 | -------------------------------------------------------------------------------- /test/fixtures/serve/async-compose/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/async-compose/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/async-compose/index.htmlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/async-compose/index.htmlt -------------------------------------------------------------------------------- /test/fixtures/serve/compose-with-router/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/compose-with-router/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/compose-with-router/index.htmlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/compose-with-router/index.htmlt -------------------------------------------------------------------------------- /test/fixtures/serve/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/head/not-supported/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/head/not-supported/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/head/not-supported/index.htmlt: -------------------------------------------------------------------------------- 1 | should not be executed <% res.set('set-by-template', ':P'); %> -------------------------------------------------------------------------------- /test/fixtures/serve/head/supported/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/head/supported/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/head/supported/index.htmlt: -------------------------------------------------------------------------------- 1 | should not be executed <% res.set('set-by-template', ':P'); %> -------------------------------------------------------------------------------- /test/fixtures/serve/index.htmlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/index.htmlt -------------------------------------------------------------------------------- /test/fixtures/serve/regular.html: -------------------------------------------------------------------------------- 1 | regular 2 | -------------------------------------------------------------------------------- /test/fixtures/serve/sub1/index.htmlt: -------------------------------------------------------------------------------- 1 | sub1 -------------------------------------------------------------------------------- /test/fixtures/serve/sub1/test.json: -------------------------------------------------------------------------------- 1 | { "loc": "sub1" } -------------------------------------------------------------------------------- /test/fixtures/serve/test: -------------------------------------------------------------------------------- 1 | { "loc": "root" } -------------------------------------------------------------------------------- /test/fixtures/serve/test.json: -------------------------------------------------------------------------------- 1 | { "loc": "root" } -------------------------------------------------------------------------------- /test/fixtures/serve/tmpl-settings/index.htmlt: -------------------------------------------------------------------------------- 1 | tmpl - {{ req.url }} -------------------------------------------------------------------------------- /test/fixtures/serve/with-compose/compose.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/with-compose/compose.js -------------------------------------------------------------------------------- /test/fixtures/serve/with-compose/index.htmlt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/fixtures/serve/with-compose/index.htmlt -------------------------------------------------------------------------------- /test/fixtures/serve/without-compose/index.htmlt: -------------------------------------------------------------------------------- 1 | without - <%= req.url %> -------------------------------------------------------------------------------- /test/spec/beforeAll-hook.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/beforeAll-hook.js -------------------------------------------------------------------------------- /test/spec/compose-error.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/compose-error.js -------------------------------------------------------------------------------- /test/spec/express-router.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/express-router.js -------------------------------------------------------------------------------- /test/spec/head-and-other-verbs.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/head-and-other-verbs.js -------------------------------------------------------------------------------- /test/spec/init.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/init.js -------------------------------------------------------------------------------- /test/spec/multiple-root-paths.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/multiple-root-paths.js -------------------------------------------------------------------------------- /test/spec/no-templates.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/no-templates.js -------------------------------------------------------------------------------- /test/spec/pushstate.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/pushstate.js -------------------------------------------------------------------------------- /test/spec/render.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/render.js -------------------------------------------------------------------------------- /test/spec/rendering-error.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/rendering-error.js -------------------------------------------------------------------------------- /test/spec/serve-static.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/serve-static.js -------------------------------------------------------------------------------- /test/spec/static-settings.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/static-settings.js -------------------------------------------------------------------------------- /test/spec/tmpl-settings.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/analog-nico/serve-spa/HEAD/test/spec/tmpl-settings.js --------------------------------------------------------------------------------