Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading files to Plunker

Tags:

plunker

Is there any way to upload multiple files to http://plnkr.co, instead of copy-pasting the code all the time? Would be great if a plunker could be connected to a github repository, or if a set of files could be dragged in.

like image 828
Serge van den Oever Avatar asked Feb 04 '14 14:02

Serge van den Oever


1 Answers

There is no built-in way to upload multiple files to Plunker.

Users have built tools to facilitate this. Please see: https://www.npmjs.org/package/plunk which is a command-line utility that will let you create plunks from the contents of a directory.

You can also bootstrap plunks by making POST requests to http://plnkr.co/edit/ where the payload has the following format:

{
  "description": "Plunk description", // Optional
  "tags": ["tag1", "tag2", ..., "tagN"], // Optional
  "files": {
    "filename1.ext": "contents of filename1.ext",
    "filename2.ext": "and so on.."
  }
}

Code for this handler: https://github.com/filearts/plunker_www/blob/0c608ae80ef30d59bfdfeaf3c2a28563f7b730e4/app.coffee#L105-L121

like image 132
Geoff Goodman Avatar answered Nov 15 '22 08:11

Geoff Goodman