本文整理匯總了Golang中github.com/raphael/goa.Service.ServeFiles方法的典型用法代碼示例。如果您正苦於以下問題:Golang Service.ServeFiles方法的具體用法?Golang Service.ServeFiles怎麽用?Golang Service.ServeFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/raphael/goa.Service
的用法示例。
在下文中一共展示了Service.ServeFiles方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MountController
// MountController mounts the API JSON schema controller under "/schema.json".
func MountController(service goa.Service) {
service.ServeFiles("/schema.json", "schema/schema.json")
}
示例2: MountController
// MountController mounts the JavaScript example controller under "/js".
func MountController(service goa.Service) {
// Serve static files under js
service.ServeFiles("/js/*filepath", "/home/raphael/go/src/github.com/raphael/goa/examples/cellar/js")
service.Info("mount", "ctrl", "JS", "action", "ServeFiles", "route", "GET /js/*")
}
示例3: MountController
// MountController mounts the swagger spec controller under "/swagger.json".
func MountController(service goa.Service) {
service.ServeFiles("/swagger.json", "swagger/swagger.json")
}