add /blogs/{blogID} and /blogs/lookup/{blogName} routes
This commit is contained in:
		
							parent
							
								
									dfc116d828
								
							
						
					
					
						commit
						dd72a1f4c1
					
				
					 5 changed files with 104 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,7 @@ import (
 | 
			
		|||
	"git.sleepycat.moe/sam/mercury/internal/database"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/api"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/api/accounts"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/api/blogs"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/app"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/auth"
 | 
			
		||||
	"git.sleepycat.moe/sam/mercury/web/frontend"
 | 
			
		||||
| 
						 | 
				
			
			@ -43,5 +44,11 @@ func Routes(app *app.App) {
 | 
			
		|||
			Get("/accounts/{accountID}", api.WrapHandlerT(accounts.GetID))
 | 
			
		||||
		r.With(app.APIAuth(database.TokenScopeAccountsMe, false)).
 | 
			
		||||
			Get("/accounts/@me", api.WrapHandlerT(accounts.GetMe))
 | 
			
		||||
 | 
			
		||||
		blogs := blogs.New(app)
 | 
			
		||||
		r.With(app.APIAuth(database.TokenScopeBlogsRead, true)).
 | 
			
		||||
			Get("/blogs/{blogID}", api.WrapHandlerT(blogs.GetID))
 | 
			
		||||
		r.With(app.APIAuth(database.TokenScopeBlogsRead, true)).
 | 
			
		||||
			Get("/blogs/lookup/{blogName}", api.WrapHandlerT(blogs.LookupName))
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue