如何在NodeJS中触发帖子请求中的网页



Bellow是我想要请求类似/zamansecimi的post方法的代码,并且我想要根据来自/zamansecimi的数据打开类似rapor.ejs的页面。

我该怎么做?

<form  method="post" action="/zamansecimi"  >
<div class="form-group">
<label for="ad">Başlangıç</label>
<input type="date" class="form-control" name="baslangic" id="baslangic"  placeholder="" required>
</div>
<div class="form-group">
<label for="soyad">Bitiş</label>
<input type="date" class="form-control" name="bitis" id="bitis" placeholder="" required>
</div>            
<div class="box-footer">
<button type="submit" value="rapor" class="btn btn-primary">Göster</button>
</div>
</div> 
</div>
</form>

当调用端点(/zamansecimi(时,后端将需要使用redirect进行响应。

如果您使用express,您可以在此处查看文档https://expressjs.com/en/api.html#res.redirect

最新更新