1.2.3 • Published 6 years ago
@anysols/server-service v1.2.3
Anysols Server Service
Anysols Server Service provides api for app server hosting
Starting core service
const AnysolsServerService = require('@anysols/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 browserCode of Conduct
License
1.2.3
6 years ago