Update API.md
This commit is contained in:
		
							parent
							
								
									9a0222c991
								
							
						
					
					
						commit
						7b9a48338c
					
				
							
								
								
									
										20
									
								
								API.md
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								API.md
									
									
									
									
									
								
							@ -147,16 +147,28 @@ module.exports.create = function (conf, deps, app) {
 | 
				
			|||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Special methods for `app`:
 | 
					Special methods for `app`:
 | 
				
			||||||
 | 
					--------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### app.handlePromise(request, response, promise, message);
 | 
					### app.handlePromise(request, response, promise, message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`handlePromise` will respond to the request with the result of `promise` as JSON.
 | 
					`handlePromise` will respond to the request with the result of `promise` as JSON.
 | 
				
			||||||
If there is an error, it will include `message` in order to help you debug.
 | 
					If there is an error, it will include `message` in order to help you debug.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					Special properties of `request`:
 | 
				
			||||||
      req.apiUrlPrefix => https://api.example.com/api/tld.domain.pkg
 | 
					--------------------------------
 | 
				
			||||||
      req.experienceId      // the example.com part of https://example.com/foo (or example.com#foo if /foo is part of the app name)
 | 
					
 | 
				
			||||||
      req.clientApiUri      // the api.example.com part of https://api.example.com/api/com.example.hello/kv/foo
 | 
					```js
 | 
				
			||||||
 | 
					req.apiUrlPrefix                    // This represents the full package path 
 | 
				
			||||||
 | 
					                                    // without any package specific endpoints    
 | 
				
			||||||
 | 
					                                    // i.e. https://api.example.com/api/tld.domain.pkg
 | 
				
			||||||
 | 
					                                    
 | 
				
			||||||
 | 
					req.experienceId                    // The instance name of an app as a whole, where an app is mounted
 | 
				
			||||||
 | 
					                                    // i.e. the 'example.com' part of https://example.com/foo
 | 
				
			||||||
 | 
					                                    //      OR 'example.com#foo' if '/foo' is part of the app's mount point
 | 
				
			||||||
 | 
					                                    
 | 
				
			||||||
 | 
					req.clientApiUri                    // The api URL for the instance of an app
 | 
				
			||||||
 | 
					                                    // the 'api.example.com' part of https://api.example.com/api/com.example.hello/kv/foo
 | 
				
			||||||
 | 
					                                    
 | 
				
			||||||
      req.pkgId             // the com.example.hello part of https://api.example.com/api/com.example.hello/kv/foo
 | 
					      req.pkgId             // the com.example.hello part of https://api.example.com/api/com.example.hello/kv/foo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      req.getSiteStore().then(function (models) {
 | 
					      req.getSiteStore().then(function (models) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user