Created
          July 17, 2020 18:44 
        
      - 
      
- 
        Save laiso/3336516dc354853b49cfa58ba89a2e8e to your computer and use it in GitHub Desktop. 
    VaporでJSONレスポンスを返す #CodePiece
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import Vapor | |
| struct MyResponse: Content { | |
| let name: String | |
| } | |
| func routes(_ app: Application) throws { | |
| app.get { req in | |
| return MyResponse(name: "popo") | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment