title: line before the async function is being called
body: <p>so I am building some simple node projects and I am making some requests using <a href="https://www.npmjs.com/package/got" rel="nofollow noreferrer">GOT</a> as the original requests lib for node is discontinued, but this weird thing keeps happening and calls anything before the async function as a function.</p>
  
  <p>below is the code I am running </p>
  
  <pre><code>let express = require("express")
  let app = express()
  let bodyparser = require("body-parser")
  const got = require('got');
  app.set("view engine", "ejs")
  
  
  app.get("/search", function(req, res){
      let query = req.query.pesq
      let url = "https://www.omdbapi.com/?s=" + query + "&amp;apikey=thewdb"
      (async () =&gt; {
          try {
              const response = got(url);
              data = JSON.parse(response.body);
              console.log("fine here")
              res.render("search", {data: data})
              //=&gt; '&lt;!doctype html&gt; ...'
          } catch (error) {
              console.log(error.code);
              //=&gt; 'Internal server error ...'
          }
      })
  })
  
  app.listen(3000, function(){
      console.log("Server has started!")
  })
  </code></pre>
  
  <p>And this is the error I get from it</p>
  
  <pre><code>TypeError: "&amp;apikey=thewdb" is not a function
  at /workspace/Bootcamp/MoviaApp/index.js:11:2
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  at next (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/route.js:137:13)
  at Route.dispatch (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/route.js:112:3)
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  at /workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:281:22
  at Function.process_params (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:335:12)
  at next (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:275:10)
  at expressInit (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/middleware/init.js:40:5)
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  </code></pre>
  
  <p>I am trying to find out why the line before the async function is being called as a function as the error shows. I tried adding a <code>console.log("check")</code> after the <code>let url</code> and I got another error:</p>
  
  <pre><code>TypeError: console.log(...) is not a function
  at /workspace/Bootcamp/MoviaApp/index.js:12:2
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  at next (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/route.js:137:13)
  at Route.dispatch (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/route.js:112:3)
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  at /workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:281:22
  at Function.process_params (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:335:12)
  at next (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/index.js:275:10)
  at expressInit (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/middleware/init.js:40:5)
  at Layer.handle [as handle_request] (/workspace/Bootcamp/MoviaApp/node_modules/express/lib/router/layer.js:95:5)
  </code></pre>
  
  <p>However I have no idea why it is having this weird behavior of calling the line before, probably it is something very simple but I can't find out. sorry if this question has already been answered but I can't find an answer.</p>
  
  <p>Update: added the <code>await</code> before the <code>got(url)</code> function and still returns the same result</p>