MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Solved 当有多个程序需要调用http接口时,应该如何书写配置文件?

    HTTP API和第三方SDK
    2
    2
    526
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • VantHoff
      VantHoff last edited by

      我现在正在使用Amiya-Bot和ChatLearning两个程序,两个程序都要求使用http接口,应该怎样正确书写mirai-api-http的配置文件呢?
      我目前的配置文件是这样的:

      adapters: 
        - http
        - ws
      debug: false
      enableVerify: true
      verifyKey: AmiyaBot
      singleMode: false
      cacheSize: 4096
      adapterSettings: 
        http:
          host: 127.0.0.1
          port: 8096
          cors: [*]
        ws:
          host: 127.0.0.1
          port: 8060
          reservedSyncId: -1
        http:
          host: 127.0.0.1
          port: 8097
          cors: [*]
      

      这样使用的话会出现两个程序都无法正确上报回复内容,应该怎么修改呢?
      如果我想使用两个不同的verifyKey的话,应该怎么书写呢?

      1 Reply Last reply Reply Quote 0
      • StageGuard
        StageGuard last edited by

        不支持也不需要分别配置,http api是提供公共接口的,你应该配置你程序的设置为http api的配置,而不是修改http api的配置为程序的设置

        1 Reply Last reply Reply Quote 0
        • StageGuard
          StageGuard last edited by

          不支持也不需要分别配置,http api是提供公共接口的,你应该配置你程序的设置为http api的配置,而不是修改http api的配置为程序的设置

          1 Reply Last reply Reply Quote 0
          • Topic has been marked as solved  VantHoff VantHoff 
          • 1 / 1
          • First post
            Last post
          Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact