How to store routes in separate files when using Hapi?

前端 未结 7 1949
醉话见心
醉话见心 2021-01-30 01:49

All of the Hapi examples (and similar in Express) shows routes are defined in the starting file:

var Hapi = require(\'hapi\');

var server = new Hapi.Server();
s         


        
7条回答
  •  梦毁少年i
    2021-01-30 01:56

    Try hapi-auto-route plugin! It's is very simple to use and allow prefix in your route path.

    Full disclosure: I am the author of this plugin

提交回复
热议问题