Skip to content

Commit

Permalink
feat(storage): provide type safety for useStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
GalacticHypernova authored Dec 10, 2023
1 parent bd5e14d commit 6210b65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/storage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createStorage as _createStorage, builtinDrivers } from "unstorage";
import type { Nitro } from "./types";

export const mountPoints=[]

export async function createStorage(nitro: Nitro) {
const storage = _createStorage();

Expand All @@ -15,6 +17,7 @@ export async function createStorage(nitro: Nitro) {
builtinDrivers[opts.driver] || opts.driver
).then((r) => r.default || r);
storage.mount(path, driver(opts));
mountPoints.push(path)
} else {
nitro.logger.warn(`No \`driver\` set for storage mount point "${path}".`);
}
Expand Down

0 comments on commit 6210b65

Please sign in to comment.