-
- Downloads
Refactor `backend.js` #5 - Simplify the main logic (#24119)
* Simplify temporary DB path * Set the port to 4000 * Move logic to create server config inside the base function * Rename `kill` function to distinguish between it and Node process `kill` * `createServer` as a method * Remove reliance on Maps * Stop server logic implemented directly in a method * Remove unneeded parameter * Start server logic implemented directly in a method * Remove `isReady` from global scope * Remove `delay` from the global scope * Rename `BackendResource` to `CypressBackend` * Rename file * Simplify `CypressBackend` No need to invoke the function when we can store everything as method definitions under `CypressBackend` object. * Pass `port` as an argument with default value * Use template literals for logging * Destructure `response` * Fix small typo in the comment * Tidy up `dbFile` in the `server`
Please register or sign in to comment