title: TypeScript ReferenceError: is not defined
body: <p>I have a typescript app. It looks like this:</p>
  
  <p>Salon.ts</p>
  
  <pre><code>export class Salon {
  clients: Client [];
  constructor() {
      this.clients = [];
  }
  
  public addClient(c: Client) {
      this.clients.push(c);
  }}
  </code></pre>
  
  <p>Client.ts</p>
  
  <pre><code>class Client {
  name: string;
  surname: string;
  constructor(name, surname){
      this.name = name;
      this.surname = surname;
  }}
  </code></pre>
  
  <p>And in my server file Serv.ts I want to get post requests with client information and add it to the clients array:</p>
  
  <pre><code>import {Salon} from "./Salon.js";
  s: Salon = new Salon();
  
  app.post("/addClient", (req, res) =&gt; {
  if (req.query.name === undefined | req.query.surname=== undefined){
      res.status(400);
      res.setHeader("Content-Type", "text/html; charset=utf-8");
      res.end("Your name and surname please");
  } else {
      console.log(req.query.name, req.query.age);
      s.addClient(new Client(req.query.name, req.query.surname));
  }
  });
  </code></pre>
  
  <p>And when I run my app and trying to make post request it give me an error "ReferenceError: s is not defined".
  How do I deal with this?</p>