で働いていない私は、URLを持っています。このURLは、パラメータでプロパティを持つエンドポイントを作成します。複数のパラメータはNodeJSエクスプレス
POST http://localhost:8082/core/api/v1/endpoints/create/endpoint3/abc/def
UPDATE:これは私のテストです
{
"message": "success",
"statuscode": 200
}
:これはJSONが成功場合返しますです
Error: Not Implemented
at router.use (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\controllers\api.js:517:14)
at Layer.handle [as handle_request] (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:312:13)
at D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:280:7
at Function.process_params (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:330:12)
at next (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:271:10)
at Function.handle (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:176:3)
at router (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:46:12)
at Layer.handle [as handle_request] (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\Study\NodeJS\ProjectEnviromentMonitoring\EnvironmentMonitoring\node_modules\express\lib\router\index.js:312:13)
:私はパラメータで要求をしようとすると、しかし...私はエラーを受け取りました: paramsを取得するコードは次のとおりです。
router.route('/endpoints/create/:name/:description/:address').post((req, res) => {
var name = req.params.name;
var description = req.params.description;
var address = req.params.address;
}
は私がのparamsを取得するために私のコードを更新してきた – rckrd
...あなたは誰があなたの助言を与えるためにあらゆる機会を持つようにしたい場合は、あなたのコードの一部を共有する必要があると思う –