koa-classic-server 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ opts = {
|
|
|
28
28
|
urlsReserved: Array(), //paths on disk that will not be accessible remotely e.g. array('/api','/views') warning nested folders are not allowed
|
|
29
29
|
template: {
|
|
30
30
|
render: undefined, //function that will take care of the rendering if there is a template engine ES --> const templateRender = async ( ctx, next, filePath) => {
|
|
31
|
-
|
|
31
|
+
ext: Array(), // template engine file extension ES :Array("ejs", "EJS"),
|
|
32
32
|
}, // emd template
|
|
33
33
|
}; // end optio
|
|
34
34
|
```
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = function koaClassicServer(
|
|
|
30
30
|
const options = opts || {};
|
|
31
31
|
options.template = opts.template || {template:{}};// necessario per rendere possibili i controlli di typo su options.template.render ecc
|
|
32
32
|
|
|
33
|
-
options.method =
|
|
33
|
+
options.method = Array.isArray( options.method ) ? options.method : Array('GET');// metod
|
|
34
34
|
options.showDirContents = typeof options.showDirContents == 'boolean' ? options.showDirContents : true;// di default le cartelle vengono mostrate
|
|
35
35
|
options.index = typeof options.index == 'string' ? options.index : "";// index filefile che viene caricato se trovato dentro la cartella
|
|
36
36
|
options.urlPrefix = typeof options.urlPrefix == 'string' ? options.urlPrefix : "";// urlPrefix
|