A curated list of browser globals that commonly cause confusion and are not recommended to use without an explicit window qualifier
Overall
score
97%
Build a development server that handles client-side routing for Single Page Applications (SPAs). The server should serve static files normally, but fall back to serving index.html for any route that doesn't match a static file.
Your development server should:
/about, /users/123)/ returns the index.html file content with status 200 @test/app.js when app.js exists returns the JavaScript file with status 200 @test/about (which doesn't exist as a file) returns index.html content with status 200 @test/users/123 (nested route) returns index.html content with status 200 @test@generates
/**
* Creates and starts a development server with SPA fallback support
* @param {Object} options - Server configuration options
* @param {number} options.port - Port number to listen on (default: 3000)
* @param {string} options.publicDir - Directory to serve static files from (default: './public')
* @returns {Object} Server instance with a close() method
*/
function createServer(options);Provides HTTP server middleware functionality for handling requests and serving static files.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-confusing-browser-globalsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10