Skip to content

Files API

tmpmachine edited this page Sep 8, 2021 · 3 revisions

Create a File

Create a new file on current path.

fetch('/codetmp/files', {
  method: 'POST',
  body: JSON.stringify({
    name:'app.data',
    content: 'Hello world',
  }),
});

You can create file on a specific path by specifying path key on request body.

fetch('/codetmp/files', {
  method: 'POST',
  body: JSON.stringify({
    name:'app.data',
    content: 'Hello world',
    path: 'data/',
  }),
});