How to pass and catch variable when the method is POST then the route is GET?Detecting request type in PHP (GET, POST, PUT or DELETE)How do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How to get the client IP address in PHPReference — What does this symbol mean in PHP?Codeigniter can't get a simple post data variableHow do I pass variables and data from PHP to JavaScript?How to get and count post variable (array) in CodeIgniter?image is not uploading in YII ActiveFormform not adding input data into db table

Is a paralyzed creature limp or rigid?

Are there mathematical concepts that exist in the fourth dimension, but not in the third dimension?

Why there is no wireless switch?

What is the source of the fear in the Hallow spell's extra Fear effect?

What drugs were used in England during the High Middle Ages?

Why are some hotels asking you to book through Booking.com instead of matching the price at the front desk?

Ceiling fan electrical box missing female screw holes

Is it possible to observe space debris with Binoculars?

How do I delete cookies from a specific site?

What's the difference between a share and a stock?

What quests do you need to stop at before you make an enemy of a faction for each faction?

Why did Boris Johnson call for new elections?

Bidirectional Dictionary

How were the names on the memorial stones in Avengers: Endgame chosen, out-of-universe?

How can I implement regular expressions on an embedded device?

Why are all volatile liquids combustible

Is a Wick rotation a change of coordinates?

Can anyone find an image of Henry Bolingbroke's Sovereygne Feather Seal?

How does the UK House of Commons think they can prolong the deadline of Brexit?

Dissuading my girlfriend from a scam

ASCII Maze Rendering 3000

Is it risky to move from broad geographical diversification into investing mostly in less developed markets?

Tying double knot of garbarge bag

To which airspace does the border of two adjacent airspaces belong to?



How to pass and catch variable when the method is POST then the route is GET?


Detecting request type in PHP (GET, POST, PUT or DELETE)How do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How to get the client IP address in PHPReference — What does this symbol mean in PHP?Codeigniter can't get a simple post data variableHow do I pass variables and data from PHP to JavaScript?How to get and count post variable (array) in CodeIgniter?image is not uploading in YII ActiveFormform not adding input data into db table






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm developing a web application, and I want to pass variable called ID when the form method is post that linked to open other form but in the config/routes I'm using $routes[page_A][get] = 'Controller' not $routes[page_A][post] = 'Controller'.



I'm using Codeigniter framework here, I've tried to change the controller with $this->input->get('id') but it doesn't work and I don't have any idea whats really happen in my codes.



The Sender Form View code



<form action="<?= base_url().'progres_save'; ?>" method="POST">
<div class="form-group">
<div class="form-row">
<label for="idJobOrder">ID Job Order</label>
<input type="text" name="idJobOrder" class="form-control" value="<?php echo $rd[0]->kodejobglobal; ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="form-row">
<a class="btn btn-primary col-xl-1 col-sm-1 mb-1 ml-auto mr-0 mr-md-2 my-0 my-md-3" href="job" id="back" role="button"><i class="fas fa-fw fa-arrow-left"></i> Back</a>
<button class="btn btn-primary btn-block col-xl-1 col-sm-1 mb-1 mr-0 mr-md-2 my-0 my-md-3">Save <i class="fa fa-fw fa-arrow-right"></i></button>
<input type="hidden" name="id" value="<?php echo $rd[0]->kodejobspesifik ?>">
</div>
</div>
</form>


The Sender Form Controller code



public function save()

$idglobal = $this->input->post('idJobOrder');

$data = array('jobnya' => $idglobal );

$this->Model_joborder->save_pg($data,'lapharian');
redirect('progres_material');



The Config Routes code



$route['progres_save']['get']='error';
$route['progres_save']['post']='save';

$route['progres_material']['get']='matused';
$route['progres_material']['post']='error';


The Recipient Form Controller code



public function matused()

$id = $this->input->get('id');
$data['rd'] = $this->Model_joborder->tampil2($id);
$data['fb'] = $this->Model_joborder->data_cbb();
$this->load->view('matused', $data);



The Recipient Form View code



<form method="POST" action="<?= base_url().'matsave'; ?>">
<div class="form-group">
<div class="form-row">
<?php if (isset($rd[0])) ?>
<input type="hidden" value="<?php echo $rd[0]->jobspesifiknya; ?>" name="idClient" class="form-control" placeholder="First name" readonly>
<?php ?>
</div>
</div>
</form>


What I expect is the input id value from Sender will be passed and catch on Recipient form as input idClient. Can anyone her help me to find out the solution? Thank you.










share|improve this question


























  • "input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

    – Stefan Avramovic
    Mar 28 at 6:55











  • @StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

    – eleonora anggi
    Mar 28 at 7:03











  • Like a chat or something like that?

    – Stefan Avramovic
    Mar 28 at 18:35

















0















I'm developing a web application, and I want to pass variable called ID when the form method is post that linked to open other form but in the config/routes I'm using $routes[page_A][get] = 'Controller' not $routes[page_A][post] = 'Controller'.



I'm using Codeigniter framework here, I've tried to change the controller with $this->input->get('id') but it doesn't work and I don't have any idea whats really happen in my codes.



The Sender Form View code



<form action="<?= base_url().'progres_save'; ?>" method="POST">
<div class="form-group">
<div class="form-row">
<label for="idJobOrder">ID Job Order</label>
<input type="text" name="idJobOrder" class="form-control" value="<?php echo $rd[0]->kodejobglobal; ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="form-row">
<a class="btn btn-primary col-xl-1 col-sm-1 mb-1 ml-auto mr-0 mr-md-2 my-0 my-md-3" href="job" id="back" role="button"><i class="fas fa-fw fa-arrow-left"></i> Back</a>
<button class="btn btn-primary btn-block col-xl-1 col-sm-1 mb-1 mr-0 mr-md-2 my-0 my-md-3">Save <i class="fa fa-fw fa-arrow-right"></i></button>
<input type="hidden" name="id" value="<?php echo $rd[0]->kodejobspesifik ?>">
</div>
</div>
</form>


The Sender Form Controller code



public function save()

$idglobal = $this->input->post('idJobOrder');

$data = array('jobnya' => $idglobal );

$this->Model_joborder->save_pg($data,'lapharian');
redirect('progres_material');



The Config Routes code



$route['progres_save']['get']='error';
$route['progres_save']['post']='save';

$route['progres_material']['get']='matused';
$route['progres_material']['post']='error';


The Recipient Form Controller code



public function matused()

$id = $this->input->get('id');
$data['rd'] = $this->Model_joborder->tampil2($id);
$data['fb'] = $this->Model_joborder->data_cbb();
$this->load->view('matused', $data);



The Recipient Form View code



<form method="POST" action="<?= base_url().'matsave'; ?>">
<div class="form-group">
<div class="form-row">
<?php if (isset($rd[0])) ?>
<input type="hidden" value="<?php echo $rd[0]->jobspesifiknya; ?>" name="idClient" class="form-control" placeholder="First name" readonly>
<?php ?>
</div>
</div>
</form>


What I expect is the input id value from Sender will be passed and catch on Recipient form as input idClient. Can anyone her help me to find out the solution? Thank you.










share|improve this question


























  • "input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

    – Stefan Avramovic
    Mar 28 at 6:55











  • @StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

    – eleonora anggi
    Mar 28 at 7:03











  • Like a chat or something like that?

    – Stefan Avramovic
    Mar 28 at 18:35













0












0








0








I'm developing a web application, and I want to pass variable called ID when the form method is post that linked to open other form but in the config/routes I'm using $routes[page_A][get] = 'Controller' not $routes[page_A][post] = 'Controller'.



I'm using Codeigniter framework here, I've tried to change the controller with $this->input->get('id') but it doesn't work and I don't have any idea whats really happen in my codes.



The Sender Form View code



<form action="<?= base_url().'progres_save'; ?>" method="POST">
<div class="form-group">
<div class="form-row">
<label for="idJobOrder">ID Job Order</label>
<input type="text" name="idJobOrder" class="form-control" value="<?php echo $rd[0]->kodejobglobal; ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="form-row">
<a class="btn btn-primary col-xl-1 col-sm-1 mb-1 ml-auto mr-0 mr-md-2 my-0 my-md-3" href="job" id="back" role="button"><i class="fas fa-fw fa-arrow-left"></i> Back</a>
<button class="btn btn-primary btn-block col-xl-1 col-sm-1 mb-1 mr-0 mr-md-2 my-0 my-md-3">Save <i class="fa fa-fw fa-arrow-right"></i></button>
<input type="hidden" name="id" value="<?php echo $rd[0]->kodejobspesifik ?>">
</div>
</div>
</form>


The Sender Form Controller code



public function save()

$idglobal = $this->input->post('idJobOrder');

$data = array('jobnya' => $idglobal );

$this->Model_joborder->save_pg($data,'lapharian');
redirect('progres_material');



The Config Routes code



$route['progres_save']['get']='error';
$route['progres_save']['post']='save';

$route['progres_material']['get']='matused';
$route['progres_material']['post']='error';


The Recipient Form Controller code



public function matused()

$id = $this->input->get('id');
$data['rd'] = $this->Model_joborder->tampil2($id);
$data['fb'] = $this->Model_joborder->data_cbb();
$this->load->view('matused', $data);



The Recipient Form View code



<form method="POST" action="<?= base_url().'matsave'; ?>">
<div class="form-group">
<div class="form-row">
<?php if (isset($rd[0])) ?>
<input type="hidden" value="<?php echo $rd[0]->jobspesifiknya; ?>" name="idClient" class="form-control" placeholder="First name" readonly>
<?php ?>
</div>
</div>
</form>


What I expect is the input id value from Sender will be passed and catch on Recipient form as input idClient. Can anyone her help me to find out the solution? Thank you.










share|improve this question
















I'm developing a web application, and I want to pass variable called ID when the form method is post that linked to open other form but in the config/routes I'm using $routes[page_A][get] = 'Controller' not $routes[page_A][post] = 'Controller'.



I'm using Codeigniter framework here, I've tried to change the controller with $this->input->get('id') but it doesn't work and I don't have any idea whats really happen in my codes.



The Sender Form View code



<form action="<?= base_url().'progres_save'; ?>" method="POST">
<div class="form-group">
<div class="form-row">
<label for="idJobOrder">ID Job Order</label>
<input type="text" name="idJobOrder" class="form-control" value="<?php echo $rd[0]->kodejobglobal; ?>" readonly>
</div>
</div>
<div class="form-group">
<div class="form-row">
<a class="btn btn-primary col-xl-1 col-sm-1 mb-1 ml-auto mr-0 mr-md-2 my-0 my-md-3" href="job" id="back" role="button"><i class="fas fa-fw fa-arrow-left"></i> Back</a>
<button class="btn btn-primary btn-block col-xl-1 col-sm-1 mb-1 mr-0 mr-md-2 my-0 my-md-3">Save <i class="fa fa-fw fa-arrow-right"></i></button>
<input type="hidden" name="id" value="<?php echo $rd[0]->kodejobspesifik ?>">
</div>
</div>
</form>


The Sender Form Controller code



public function save()

$idglobal = $this->input->post('idJobOrder');

$data = array('jobnya' => $idglobal );

$this->Model_joborder->save_pg($data,'lapharian');
redirect('progres_material');



The Config Routes code



$route['progres_save']['get']='error';
$route['progres_save']['post']='save';

$route['progres_material']['get']='matused';
$route['progres_material']['post']='error';


The Recipient Form Controller code



public function matused()

$id = $this->input->get('id');
$data['rd'] = $this->Model_joborder->tampil2($id);
$data['fb'] = $this->Model_joborder->data_cbb();
$this->load->view('matused', $data);



The Recipient Form View code



<form method="POST" action="<?= base_url().'matsave'; ?>">
<div class="form-group">
<div class="form-row">
<?php if (isset($rd[0])) ?>
<input type="hidden" value="<?php echo $rd[0]->jobspesifiknya; ?>" name="idClient" class="form-control" placeholder="First name" readonly>
<?php ?>
</div>
</div>
</form>


What I expect is the input id value from Sender will be passed and catch on Recipient form as input idClient. Can anyone her help me to find out the solution? Thank you.







php codeigniter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 6:46







eleonora anggi

















asked Mar 28 at 4:09









eleonora anggieleonora anggi

357 bronze badges




357 bronze badges















  • "input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

    – Stefan Avramovic
    Mar 28 at 6:55











  • @StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

    – eleonora anggi
    Mar 28 at 7:03











  • Like a chat or something like that?

    – Stefan Avramovic
    Mar 28 at 18:35

















  • "input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

    – Stefan Avramovic
    Mar 28 at 6:55











  • @StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

    – eleonora anggi
    Mar 28 at 7:03











  • Like a chat or something like that?

    – Stefan Avramovic
    Mar 28 at 18:35
















"input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

– Stefan Avramovic
Mar 28 at 6:55





"input id value from Sender will be passed and catch on Recipient form" Can you explain a bit more? How do you mean pass to recipient?

– Stefan Avramovic
Mar 28 at 6:55













@StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

– eleonora anggi
Mar 28 at 7:03





@StefanAvramovic In Sender form, there is an input named id which has 1 as the value, then I want to pass that value into Recipient form.

– eleonora anggi
Mar 28 at 7:03













Like a chat or something like that?

– Stefan Avramovic
Mar 28 at 18:35





Like a chat or something like that?

– Stefan Avramovic
Mar 28 at 18:35












2 Answers
2






active

oldest

votes


















0
















You can use PHP global variable $_REQUEST to capture the data if you are not sure about the request type like this,



public function matused()

$id = $_REQUEST['id'];
$data['rd'] = $this->Model_joborder->tampil2($id);
$data['fb'] = $this->Model_joborder->data_cbb();
$this->load->view('matused', $data);






share|improve this answer
































    0
















    You forgot to include the id data on the redirect after the save() method is called, so you will not get anything by calling $this->input->get('id').



    To solve this, pass the id data along with the redirect :



    redirect('progres_material?id=' . $this->input->post('id'));


    But that of course it will gives you an extra parameter on the url. If you don't want additional parameter, you could alternatively use session to pass id data while redirecting, on CodeIgniter there is a method called set_flashdata to do this :



    $this->session->set_flashdata('id', $this->input->post('id'));
    redirect('progres_material');


    And to get the id session data on the matused() method, use the following code :



    $id = !empty($this->session->flashdata('id')) ? $this->session->flashdata('id') : $this->input->get('id');





    share|improve this answer



























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390022%2fhow-to-pass-and-catch-variable-when-the-method-is-post-then-the-route-is-get%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0
















      You can use PHP global variable $_REQUEST to capture the data if you are not sure about the request type like this,



      public function matused()

      $id = $_REQUEST['id'];
      $data['rd'] = $this->Model_joborder->tampil2($id);
      $data['fb'] = $this->Model_joborder->data_cbb();
      $this->load->view('matused', $data);






      share|improve this answer





























        0
















        You can use PHP global variable $_REQUEST to capture the data if you are not sure about the request type like this,



        public function matused()

        $id = $_REQUEST['id'];
        $data['rd'] = $this->Model_joborder->tampil2($id);
        $data['fb'] = $this->Model_joborder->data_cbb();
        $this->load->view('matused', $data);






        share|improve this answer



























          0














          0










          0









          You can use PHP global variable $_REQUEST to capture the data if you are not sure about the request type like this,



          public function matused()

          $id = $_REQUEST['id'];
          $data['rd'] = $this->Model_joborder->tampil2($id);
          $data['fb'] = $this->Model_joborder->data_cbb();
          $this->load->view('matused', $data);






          share|improve this answer













          You can use PHP global variable $_REQUEST to capture the data if you are not sure about the request type like this,



          public function matused()

          $id = $_REQUEST['id'];
          $data['rd'] = $this->Model_joborder->tampil2($id);
          $data['fb'] = $this->Model_joborder->data_cbb();
          $this->load->view('matused', $data);







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 4:39









          RopAli MunshiRopAli Munshi

          8912 gold badges7 silver badges23 bronze badges




          8912 gold badges7 silver badges23 bronze badges


























              0
















              You forgot to include the id data on the redirect after the save() method is called, so you will not get anything by calling $this->input->get('id').



              To solve this, pass the id data along with the redirect :



              redirect('progres_material?id=' . $this->input->post('id'));


              But that of course it will gives you an extra parameter on the url. If you don't want additional parameter, you could alternatively use session to pass id data while redirecting, on CodeIgniter there is a method called set_flashdata to do this :



              $this->session->set_flashdata('id', $this->input->post('id'));
              redirect('progres_material');


              And to get the id session data on the matused() method, use the following code :



              $id = !empty($this->session->flashdata('id')) ? $this->session->flashdata('id') : $this->input->get('id');





              share|improve this answer





























                0
















                You forgot to include the id data on the redirect after the save() method is called, so you will not get anything by calling $this->input->get('id').



                To solve this, pass the id data along with the redirect :



                redirect('progres_material?id=' . $this->input->post('id'));


                But that of course it will gives you an extra parameter on the url. If you don't want additional parameter, you could alternatively use session to pass id data while redirecting, on CodeIgniter there is a method called set_flashdata to do this :



                $this->session->set_flashdata('id', $this->input->post('id'));
                redirect('progres_material');


                And to get the id session data on the matused() method, use the following code :



                $id = !empty($this->session->flashdata('id')) ? $this->session->flashdata('id') : $this->input->get('id');





                share|improve this answer



























                  0














                  0










                  0









                  You forgot to include the id data on the redirect after the save() method is called, so you will not get anything by calling $this->input->get('id').



                  To solve this, pass the id data along with the redirect :



                  redirect('progres_material?id=' . $this->input->post('id'));


                  But that of course it will gives you an extra parameter on the url. If you don't want additional parameter, you could alternatively use session to pass id data while redirecting, on CodeIgniter there is a method called set_flashdata to do this :



                  $this->session->set_flashdata('id', $this->input->post('id'));
                  redirect('progres_material');


                  And to get the id session data on the matused() method, use the following code :



                  $id = !empty($this->session->flashdata('id')) ? $this->session->flashdata('id') : $this->input->get('id');





                  share|improve this answer













                  You forgot to include the id data on the redirect after the save() method is called, so you will not get anything by calling $this->input->get('id').



                  To solve this, pass the id data along with the redirect :



                  redirect('progres_material?id=' . $this->input->post('id'));


                  But that of course it will gives you an extra parameter on the url. If you don't want additional parameter, you could alternatively use session to pass id data while redirecting, on CodeIgniter there is a method called set_flashdata to do this :



                  $this->session->set_flashdata('id', $this->input->post('id'));
                  redirect('progres_material');


                  And to get the id session data on the matused() method, use the following code :



                  $id = !empty($this->session->flashdata('id')) ? $this->session->flashdata('id') : $this->input->get('id');






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 9 at 7:56









                  Hasta DhanaHasta Dhana

                  3,4202 gold badges12 silver badges22 bronze badges




                  3,4202 gold badges12 silver badges22 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390022%2fhow-to-pass-and-catch-variable-when-the-method-is-post-then-the-route-is-get%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                      Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript