1.3.0 • Published 5 years ago

anysols-platform v1.3.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
5 years ago

Anysols Server Service

Anysols Server Service provides api for app server hosting

Coverage Status

Starting core service

const AnysolsServerService = require('anysols-server-service');

const serverService = new AnysolsServerService({
    "port": "8080",
    "paths" : {
        views: __dirname + "/views",
        assets: __dirname + "/assets"
    },
    "pages": {
        "404": "404"
    }
}, null);

serverService.start().then(() => {
    console.log("Server service is up and running");
    setTimeout(function () {
        console.log("Stopping Server service after 10 seconds");
        serverService.stop().then(() => {
            console.log("Server service shutdown successfully");
        });
    }, 10000);
}, function (err) {
    console.log(err.message);
});

Defining schema and querying collection

serverService.get("/my-path", {}, (req, res, next) => {
    res.send("testing");
});
// open http://localhost:8080/my-path in browser

Code of Conduct

Contributor Covenant

License

Apache License 2.0