0
嘗試使用FeathersJS時,我試圖在文檔之後創建兩個服務。第一個叫x,另一個叫y。如何使用knex postgres創建FeathersJS服務
當我創建
~/r/feathers-chat ❯❯❯ feathers generate service
? What kind of service is it? KnexJS
? What is the name of the service? x
? Which path should the service be registered on? /x
? Which database are you connecting to? PostgreSQL
? What is the database connection string?
postgres://user:[email protected]:5432/feathers_chat
一切完美X。
當我創建ÿ
~/r/feathers-chat ❯❯❯ feathers generate service
? What kind of service is it? KnexJS
? What is the name of the service? y
? Which path should the service be registered on? /y
? Which database are you connecting to? PostgreSQL
以下錯誤被拋出。
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:88:11)
at Object.urlParse [as parse] (url.js:82:5)
at ConnectionGenerator._getConfiguration (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:46:24)
at ConnectionGenerator._writeConfiguration (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:103:32)
at ConnectionGenerator.writing (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:293:10)
at Object.<anonymous> (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:25
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/run-async/index.js:24:19
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:666:20)
看來,feathersJS客戶端崩潰時出現在default.js
所以,如果我創建前手的連接所形成的Postgres連接,在與完全相同創建第一個服務的客戶端崩潰錯誤。
我不明白我做錯了什麼,任何幫助創建這個第二個服務使用相同的postgres數據庫表示讚賞!