如何使用不同的请求正文在Node.js Express中重定向

时间:2018-12-25 17:51:06

标签: node.js express request

我正在制作网页,这是我的一些代码

在app.ts中

25-Dec-2018 20:35:48.563 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Change Observer 1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

在index-router.ts中

import * as express from 'express';
import knex from './init/knex';

// Router
import indexRouter from './routers/index-router';

// Service
import gameService from './service/game-service';

const app = express();
var server = app.listen(8080, () => {
   console.log('listen to 8080');
})

app.use('/', new indexRouter(new gameService(knex)).router());

当用户链接到“ http://localhost:8080/”并调用“获取”方法时 我该如何更改:

  1. 从“ http://localhost:8080/”到“ http://localhost:8080/test”的网址
  2. 使用新的请求正文调用“测试”方法

我花了很多时间Google如何做我,但我找不到做上述两件事的最佳方法。

1 个答案:

答案 0 :(得分:1)

您的意思是:

Sub Copy_From_Word()

    Application.DisplayAlerts = False 'Disable all the Alerts from excel
    Application.ScreenUpdating = False 'After opening Word Doc, Document will not be visible
    'Create a New Object for Microsoft Word Application
    Dim objWord As New Word.Application
    'Create a New Word Document Object
    Dim objDoc As New Word.Document
    'Open a Word Document and Set it to the newly created object above
    Set objDoc = objWord.documents.Open("C:\path_here\your_document.docx")
    'To Store all the content of that word Document in a variable
    strTemp = objDoc.Range(0, objDoc.Range.End)
    'Now store that variable value in to a cell range
    Range("A1").Value = strTemp
    str1 = objDoc.Range(0, 1)
    Range("A2").Value = str1
    Range("B2").Value = strTemp

    objDoc.Close SaveChanges:=wdDoNotSaveChanges
    objWord.Quit

End Sub