Hemmelig.app/server/services/file-adapter.js
bjarneo 0c86efd56c
refactor: use fastify vite for the dev server (#284)
* refactor: use fastify vite for the server

by doing this we do not need to have local hacks for the routes. No local proxy needed. Everything just works.

* fix: update the dockerfile build path

* fix: update package.json

* fix: fonts path
2024-03-11 13:43:20 +01:00

25 lines
568 B
JavaScript

import config from 'config';
import * as disk from './disk.js';
// It is using the s3 package, which means it works for s3 buckets as well
import * as digitalocean from './do.js';
function fileAdapter() {
const adapter = config.get('file.adapter');
if (adapter === 'do') {
return digitalocean;
} else if (adapter === 'disk') {
return disk;
} else {
return {
upload: () => {},
download: () => {},
remove: () => {},
};
}
}
const adapter = fileAdapter();
export default adapter;