xml-express
v1.1.2
Published
An express server that accepts xml as its config
Downloads
2
Readme
Easy to use XML Express Library
Just add:
const xmlserv = require('xml-express');
const app = express();
const file = "path/to/xml/file";
xmlserv.config(app, file);
It will listen by default on port 3000, no need for app.listen
, or configure a custom port.
Example of xml config file:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<server>
<static dir="public"></static>
<route path="/" to="index.html"></route>
<script>
function configureCustomRoutes(app) {
app.get('/custom', (req, res) => {
res.send('This is a custom route!');
});
}
configureCustomRoutes(app);
</script>
</server>
</root>