Skip to content
forked from weakish/fileup

A file uploader demo powered by LeanCloud and Svelte.

License

Notifications You must be signed in to change notification settings

leancloud/fileup

 
 

Repository files navigation

When Svelte Meets LeanCloud Files

This is a simple file uploader demo built with LeanCloud, Svelte, and TypeScript.

Quick Start

Configuration

Register an account and create an application at LeanCloud, and fill in your application information in src/App.svelte:

const appId = "your app id";
const appKey = "your app key";
const serverURL = "https://your-custom-domain.example.com";

You can obtain the required information from LeanCloud dashboard (Settings > AppKey). The domain name in serverURL is the first domain in Settings > AppKey > Domain whitelist > Request domain.

You probabaly do not want to allow anyone to query all URLs of all the uploaded files. Thus you need to configure the find permission of files to 0 Role, 0 User (Data Storage > Files > Permission > Class permissions).

Install Dependencies

npm install

Start a Local Server

npm run dev

Build for the Production Environment

npm run build

Then upload the public directory to any web hosting service, e.g. LeanEngine:

cd public
lean switch --region us-w1 --group web YOUR_APP_ID
lean deploy --prod 1 

About

A file uploader demo powered by LeanCloud and Svelte.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 38.7%
  • Svelte 35.3%
  • CSS 16.6%
  • HTML 7.3%
  • TypeScript 2.1%