10 examples of 'app listen' in JavaScript

Every line of 'app listen' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
17function listen(app) {
18 var apiUrl = url.parse(config.get('basket.api_url'));
19 app.listen(apiUrl.port, apiUrl.hostname);
20 logger.info(`FxA Fake Basket Server listening on port ${apiUrl.port}`);
21 return true;
22}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

20async function listen(
21 app: express.Express,
22 port: number
23): Promise<http.Server> {
24 return new Promise((resolve, reject) => {
25 const server = app.listen(port, (err: Error) => {
26 if (err) {
27 reject(err);
28 }
29 resolve(server);
30 });
31 });
32}
37function _listen(port, hostName) {
38 _listeningServer = _serverApp.listen(port, hostName);
39}
11function start(app) {
12 const port = config.port;
13 app.listen(port, (error) => {
14 if (error) {
15 logger.error("Can't start server: ", error);
16 }
17 logger.info("Listening on port: ", port);
18 });
19}
17function doListen() {
18 listener = app.listen(port, () => {
19 log.info('Server is listening to port %d', listener.address().port);
20 });
21 return listener;
22}
58_listen(name, listening) {
59 if (EVENT_TYPES.includes(name)) {
60 this._nativeListen(name, listening);
61 } else {
62 super._listen(name, listening);
63 }
64}
198server.listen(opts.port, function onListening() {
199 log.info({
200 port: opts.port
201 }, 'mountd: ready');
202});
34function startListen() {
35 app.set('port', nconf.get('env:HTTP_PORT') || 80);
36 app.listen(app.get('port'));
37}
15public listen(port: number, callback?: Function): http.Server {
16 return this.app.listen(port, callback);
17}
9listen (port, options) {
10 console.log(`listening in port [${port}]`)
11}

Related snippets