Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: resource loader service #622

Closed
3 tasks
crookse opened this issue Mar 22, 2022 · 0 comments · Fixed by #644
Closed
3 tasks

feat: resource loader service #622

crookse opened this issue Mar 22, 2022 · 0 comments · Fixed by #644
Assignees

Comments

@crookse
Copy link
Member

crookse commented Mar 22, 2022

Summary

What:

Make a service that loads all resources in given directories.

Why:

Manually typing in the import statement and writing the resource class names in the resources config can be cumbersome.

Acceptance Criteria

Below is a list of tasks that must be completed before this issue can be closed.

  • Write documentation
  • Write unit tests
  • Write integration tests

Example Pseudo Code (for implementation)

import { ResourceLoaderService } from "...";

const server = new Drash.Server({
  // ResourceLoaderService yields a single array of resources from multiple paths and excludes whatever is in `exclude`
  resources: new ResourceLoaderService({ 
    paths: [ "./src/v1/resources", "./src/v2/resources" ],
    exclude: [ HomeResource, SecretResource, SomeResource ]
  })
});
@crookse crookse self-assigned this Apr 8, 2022
@crookse crookse changed the title Resource loader service feat: ResourceLoaderService May 29, 2022
@crookse crookse changed the title feat: ResourceLoaderService feat: resource loader service May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant