How to use the @keystonejs/file-adapters.LocalFileAdapter function in @keystonejs/file-adapters

To help you get started, we’ve selected a few @keystonejs/file-adapters examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keystonejs / keystone / test-projects / basic / index.js View on Github external
const LOCAL_FILE_ROUTE = `${staticRoute}/avatars`;

const Stars = require('./custom-fields/Stars');
const getYear = require('date-fns/get_year');

// TODO: Make this work again
// const SecurePassword = require('./custom-fields/SecurePassword');

const { MongooseAdapter } = require('@keystonejs/adapter-mongoose');

const keystone = new Keystone({
  name: 'Cypress Test Project Basic',
  adapter: new MongooseAdapter(),
});

const fileAdapter = new LocalFileAdapter({
  src: LOCAL_FILE_SRC,
  path: LOCAL_FILE_ROUTE,
});

let embedAdapter;

if (process.env.NODE_ENV === 'test') {
  embedAdapter = new MockOEmbedAdapter();
} else if (iframely.apiKey) {
  embedAdapter = new IframelyOEmbedAdapter({ apiKey: iframely.apiKey });
}

let cloudinaryAdapter;
try {
  cloudinaryAdapter = new CloudinaryAdapter({
    ...cloudinary,

@keystonejs/file-adapters

Adapters for handling storage of the File type

MIT
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages