ufront / ufront-mvc

The core MVC framework that powers ufront
MIT License
17 stars 15 forks source link

Proposal: revamp listen() arguments #50

Closed kevinresol closed 6 years ago

kevinresol commented 8 years ago

I propose the argument (currently only port) of listen() to be revamped as follow, solves #34 & #47.

ufrontApp.listen({
    port:2987, //optional
    path:'systemd', //optional: becomes `server.listen('systemd');`
    https: { // refer to node doc
        key: "",
        cert: "",
    },
    parserLimit: '1500kb', // pass to body-parser
    staticPaths: ['.', 'files => ../uf-content'], // becomes `app.use( express.Express.serveStatic(".") );`` & `app.use( '/files', express.Express.serveStatic(js.Node.__dirname + "/../uf-content") );``
});

Maybe staticPaths can be put in ufront config

kevinresol commented 8 years ago

Hm...Server's listen() function is actually quite overloaded

I am not sure what is the best way to expose the listen function properly...

kevinresol commented 6 years ago

Cleaning up my old issues and I think this is no longer needed.