tomcat-manager-api

0.0.2 • Public • Published

tomcat-manager-api

  • Promise-based interface to tomcat manager

Installation / setup

npm install tomcat-manager-api --save

Usage

from node

const {TomcatManager} = require('tomcat-manager-api')

new TomcatManager()
    .serverUrl(`http://my-tomcat-server:8080`)
    .username('myusername')
    .password('mypassword')
    .listApps()
    .then((tomcatInfo)=>{
        console.log(`tomcatInfo=${JSON.stringify(tomcatInfo)}`); 
        console.log(`command status: ${tomcatInfo.commandStatus}`)
        console.log(`No. apps: ${tomcatInfo.apps.length}`)
    })
    .catch((err)=>console.log(`problem, err=${err}))

output

tomcatInfo={
  "apps": [
    {
      "context": "/",
      "state": "running",
      "num": "0",
      "name": "ROOT"
    },
    {
      "context": "/examples",
      "state": "running",
      "num": "0",
      "name": "examples"
    },
    {
      "context": "/host-manager",
      "state": "running",
      "num": "0",
      "name": "host-manager"
    },
    {
      "context": "/manager",
      "state": "running",
      "num": "1",
      "name": "manager"
    },
    {
      "context": "/docs",
      "state": "running",
      "num": "0",
      "name": "docs"
    }
  ],
  "commandUrl": "http://my-tomcat-server:8080/manager/text/list",
  "commandStatus": "OK - Listed applications for virtual host [localhost]"
}
command status: OK - Listed applications for virtual host [localhost]
No. apps: 5

Resources

Readme

Keywords

Package Sidebar

Install

npm i tomcat-manager-api

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

4.81 kB

Total Files

5

Last publish

Collaborators

  • javapda