(filename: string)
| 11 | const API_BASE_URL = `${SRCBOOK_CONFIG.api.origin}/api`; |
| 12 | |
| 13 | export async function getFileContent(filename: string) { |
| 14 | const file_response = await fetch(API_BASE_URL + '/file', { |
| 15 | method: 'POST', |
| 16 | headers: { |
| 17 | 'Content-Type': 'application/json', |
| 18 | }, |
| 19 | body: JSON.stringify({ |
| 20 | file: filename, |
| 21 | }), |
| 22 | }); |
| 23 | return await file_response.json(); |
| 24 | } |
| 25 | |
| 26 | interface CreateSrcbookRequestType { |
| 27 | path: string; |