我在编译代码时遇到错误:找不到 serviceIdentifier: Symbol(LicencesService) 的匹配绑定 以下是与该问题相关的代码。问题在于 server.ts 文件上 HTTP 的构造函数,如何正确注入 LicensesService?
我的打字文件:-
const TYPES = {
LicencesService:Symbol.for('LicencesService')
}
export { TYPES }
Run Code Online (Sandbox Code Playgroud)
我的 server.ts 文件:-
import { LogsRepository } from './repositories/logs'
import { TelemetryRepository } from './repositories/telemetry'
import { AdminRouter, AuthRouter, BotsRouter, ModulesRouter } from './routers'
import { ContentRouter } from './routers/bots/content'
import { ConverseRouter } from './routers/bots/converse'
import { HintsRouter } from './routers/bots/hints'
import { NLURouter } from './routers/bots/nlu'
import { isDisabled } from './routers/conditionalMiddleware'
import { InvalidExternalToken, PaymentRequiredError } …Run Code Online (Sandbox Code Playgroud) 我已经配置了 nginx 将请求升级到 https
server {
listen xxx.xxx.xxx.xxx:80;
listen xxx.xxx.xxx.xxx:443 ssl;
server_name example.com www.example.com
access_log /var/log/nginx/www.example.com_access.log;
error_log /var/log/nginx/www.example.com_error.log warn;
ssl_certificate /etc/nginx/ssl/certificates/www.example.com.crt;
ssl_certificate_key /etc/nginx/ssl/certificates/www.example.com.key;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#https://www.scalescale.com/tips/nginx/504-gateway-time-out-using-nginx/
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
proxy_pass https://xxx.xxx.xxx.xxx:8443/;
index index.html ;
}
}
Run Code Online (Sandbox Code Playgroud)
但配置并未将请求升级到 https。
我在仪表板模块中有一个名为:WhatsAppConversationComponent 的组件。我无法使用仪表板路由中的路由路由到 WhatsAppConversationComponent。
我的仪表板模块
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(DashboardRoutes),
FormsModule,
MdModule,
MaterialModule
],
declarations: [
DashboardComponent,
SurveyComponent,
QuestionnaireComponent,
SurveyReportComponent,
WhatsAppConversationComponent
]
})
export class DashboardModule { }
Run Code Online (Sandbox Code Playgroud)
我的仪表板路由模块
export const DashboardRoutes: Routes = [
{
path: '',
children: [{
path: 'dashboard',
component: DashboardComponent
}, {
path: 'questionnaire',
component: QuestionnaireComponent
}, {
path: 'survey',
component: SurveyComponent
}, , {
path: 'whatsappconversation',
component: WhatsAppConversationComponent
}, {
path: 'survey-report',
component: SurveyReportComponent
}]
}
];
Run Code Online (Sandbox Code Playgroud)
当我到达路线/whatsappconversation时,我面临以下错误:-
core.js:3838 ERROR Error: Uncaught (in promise): TypeError: Cannot …Run Code Online (Sandbox Code Playgroud) typescript ×2
angular ×1
express ×1
https ×1
inversifyjs ×1
nginx ×1
node.js ×1
reactjs ×1
server ×1