Skip to content

Feature complete file browser for Vite/Vue + Express

Notifications You must be signed in to change notification settings

MomsFriendlyDevCo/vue-file-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@MomsFriendlyDevCo/Vue-File-Browser

Pluggable fully-featured file-management module for Vue + Express.

Integration

Backend

Import the Express injectable into your ExpressJS project:

See src/files.js for a full list of.

import FileBrowser from '@momsfriendlydevco/vue-file-browser/backend';

// Initalize `app` somehow - `const app = express()` usually

// Inject the FileBrowser backend
FileBrowser({
    app, // Pass on the Express style app for decoration

    // Read in config from .env / Vite env or specify defaults
    rootPath: app.config.FILES_ROOT,
    thumbsPath: app.config.FILES_THUMBS_ROOT,
    glob: (app.config.FILES_GLOB ?? '**/*.{gif,jpg,jpeg,png,webp} | **/.gander.json').split(/\s*\|\s*/),
    meta: app.config.FILES_META ?? '.gander.json',

    // ...see ./src/files.js for full options list
});

Frontend

Include the Vue component in your frontend wrapper code:

See src/files.vue for a full list of.

<script>
import FileBrowser from '@momsfriendlydevco/vue-file-browser/frontend';

export default {
	components: {
		// Injectable FileBrowser frontend component
		FileBrowser,
	},
}
</script>

<template>
	<FileBrowser
		:endpoints="{
			list: '/api/files',
		}"
	/>
</template>

About

Feature complete file browser for Vite/Vue + Express

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published