wabe-buns3
v0.5.1
Published
Bun S3 adapter for Wabe
Readme
What is Wabe?
Wabe is an open-source backend as a service that allows you to create your own fully customizable backend in just a few minutes. It handles database access, automatic GraphQL API generation, authentication with various methods (classic or OAuth), permissions, security, and more for you.
Install for wabe-buns3
bun install wabe # On bun
npm install wabe # On npm
yarn add wabe # On yarn
bun install wabe-buns3 # On bun
npm install wabe-buns3 # On npm
yarn add wabe-buns3 # On yarnBasic example of wabe-buns3 usage
import { Wabe } from "wabe";
import { MongoAdapter } from "wabe-mongodb"
import { Buns3Adapter } from "wabe-buns3";
const run = async () => {
// Ensure your database is running before run the file
const wabe = new Wabe({
isProduction: process.env.NODE_ENV === 'production',
// Root key example (must be long minimal 64 characters, you can generate it online)
rootKey:
"0uwFvUxM$ceFuF1aEtTtZMa7DUN2NZudqgY5ve5W*QCyb58cwMj9JeoaV@d#%29v&aJzswuudVU1%nAT+rxS0Bh&OkgBYc0PH18*",
database: {
adapter: new MongoAdapter({
databaseName: "WabeApp",
url: "mongodb://127.0.0.1:27045",
})
},
file: {
adapter : new Buns3Adapter({
accessKeyId: 'accessKeyId',
secretAccessKey: 'secretAccessKey',
bucket: 'bucketName',
endpoint: 'endpoint',
}),
}
port: 3001,
});
await wabe.start();
// The upload file and the read file is automatically managed in the GraphQL API
await wabe.controllers.file.uploadFile(new File(['test'], 'test.txt'));
const url = await wabe.controllers.file.readFile('test.txt');
};
await run();