File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 87
87
description : 'This route showes this page.'
88
88
}
89
89
]
90
+ } ,
91
+ {
92
+ name : 'Chat' ,
93
+ route : '/v1/chat' ,
94
+ routes : [
95
+ {
96
+ route : '/completions' ,
97
+ description : 'route for chat, follow OpenAI request & response format'
98
+ }
99
+ ]
100
+ } ,
101
+ {
102
+ name : 'Token' ,
103
+ route : '/v1/token' ,
104
+ routes : [
105
+ {
106
+ route : '/api-key' ,
107
+ description : 'get an API key for request chat'
108
+ }
109
+ ]
90
110
}
91
111
]
92
112
Original file line number Diff line number Diff line change 1
1
import { Router } from "express" ;
2
+ import { generateAPIKey } from "../tools/generator.js" ;
2
3
3
4
export default function tokenRoute ( ) {
4
5
const router = Router ( ) ;
6
+
7
+ router . get ( '/api-key' , ( _ , res ) => {
8
+ res . send ( { api_key : generateAPIKey ( ) } )
9
+ } )
10
+
5
11
return router ;
6
12
}
You can’t perform that action at this time.
0 commit comments