public final class Middleware extends Object
| Modifier and Type | Method and Description |
|---|---|
static express.middleware.CookieSession |
cookieSession(String cookieName,
long maxAge)
Create an new cookie-session middleware.
|
static FileProvider |
statics(String directoryPath)
This class serves an entire folder which can contains static file for your
web application, You can use
StaticOptions to add som configurations. |
static FileProvider |
statics(String directoryPath,
FileProviderOptions staticOptions)
This class serves an entire folder which can contains static file for your
web application, You can use
StaticOptions to add som configurations. |
public static express.middleware.CookieSession cookieSession(String cookieName, long maxAge)
cookieName - An name for the session-cookie, it's recommend to use NOT SID for security reasonsmaxAge - An max-age for the cookiepublic static FileProvider statics(String directoryPath) throws IOException
StaticOptions to add som configurations.directoryPath - The root directoryIOException - If path cannot be found or something like thatpublic static FileProvider statics(String directoryPath, FileProviderOptions staticOptions) throws IOException
StaticOptions to add som configurations.directoryPath - The root directorystaticOptions - Optional options for the file serving.IOException - If path cannot be found or something like thatCopyright © 2019. All rights reserved.