mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 02:42:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 
 | |
| const registerAPI = function (app) {
 | |
|   app.post('/login', async (req, res) => {
 | |
|     res.send({
 | |
|       result: 'success'
 | |
|     })
 | |
|   })
 | |
| 
 | |
|   // get user info
 | |
|   app.get('/account/profile', async (req, res) => {
 | |
|     res.send({
 | |
|       id: '11122222',
 | |
|       name: 'Joel',
 | |
|       email: 'iamjoel007@gmail.com'
 | |
|     })
 | |
|   })
 | |
| 
 | |
|   // logout
 | |
|   app.get('/logout', async (req, res) => {
 | |
|     res.send({
 | |
|       result: 'success'
 | |
|     })
 | |
|   })
 | |
| 
 | |
|   // Langgenius version
 | |
|   app.get('/version', async (req, res) => {
 | |
|     res.send({
 | |
|       current_version: 'v1.0.0',
 | |
|       latest_version: 'v1.0.0',
 | |
|       upgradeable: true,
 | |
|       compatible_upgrade: true
 | |
|     })
 | |
|   })
 | |
| 
 | |
| }
 | |
| 
 | |
| module.exports = registerAPI
 | |
| 
 | 
