-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
[Decorator] Static #12
Comments
The module serve-static can do that. No ? class ServerLoader {
$onMountingMiddlewares(){
const serveStatic = require('serve-static');
this.getExpressApp()
.use(serveStatic('app'))
.use('/css', serveStatic('css-files'));
}
} |
Yes it can do it and it will do it. The proposal is only syntactic sugar. If one have to implement this he have to be careful with
Usually syntactic sugar shrinks the room for errors. ;) |
Ok Alex :) you can propose your implementation of this decorator ! |
Sure you can assign it to me! I will do it at the end of the week. I always wanted to extract express utils in a library like this but somehow managed not to do it. Your project is exactly the right thing I needed for migrating an older project in the brave new world of typescript. |
You are assigned to this task :D |
Cool thanks. You can assign #13 to me too. |
Implemented with the new decorator @ServerSettings({
"serveStatic": {
"\": "webapp"
}
})
class Server extends ServerLoader {} |
If we want to add some static resources we have to:
It would be nice to add static resources from decorators. This decorator could be added to server.
Example:
The text was updated successfully, but these errors were encountered: