Skip to content

Commit

Permalink
fix: Make sure the injected function name doesn't conflict with restr…
Browse files Browse the repository at this point in the history
…icted function names
  • Loading branch information
nicolasdao committed Dec 11, 2017
1 parent a42b295 commit 4feb1eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/webfunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ const listen = (functionName, port) => {
: `Ready to receive traffic on ${`http://localhost:${port}`.bold.italic}`.cyan
const secondMsg = notLocal ? '' : 'Press Ctrl+C to stop the server'.cyan
return `
const express = require('express')
const server = express()
server.all('*', ${functionName})
server.listen(${port}, () => { console.log("${startMessage}"); ${secondMsg ? `console.log("${secondMsg}")` : ''}})
const __express__ = require('express')
const __server__ = __express__()
__server__.all('*', ${functionName})
__server__.listen(${port}, () => { console.log("${startMessage}"); ${secondMsg ? `console.log("${secondMsg}")` : ''}})
`
}
case 'gcp':
Expand Down

0 comments on commit 4feb1eb

Please sign in to comment.