Skip to content

Commit

Permalink
Fix misplace comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpetros committed Oct 9, 2023
1 parent 761318d commit 5c73965
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/ws-sse/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ function createWebSocket (connectionFunc, closeFunc) {
}

async function serveFileFromStatic (req, res) {
// For the root, serve the static index.html file
const resource = req.url === '/' ? '/index.html' : req.url

let fp = path.join('./static/', resource)
// For the root, serve the static index.html file

let lstat = await fs.lstat(fp)

// If it's a directory, re-set the fp to be the index.html of that directory
Expand Down Expand Up @@ -163,7 +162,7 @@ function makeStream(req, res, arr, formatFunc, numEvents = 0) {
res.write(event)
i++
} catch (error) {
// Stop the interval if it errors for any reason (likely beacuse end of the array way reached)
// Stop the interval if it errors for any reason
clearInterval(interval)
}
}, intervalLength)
Expand Down

0 comments on commit 5c73965

Please sign in to comment.