Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

dennisbruner/hcloud-js

Repository files navigation

hcloud-js

StandardJS License Documentation Status Travis Known Vulnerabilities

A Node.js module for the Hetzner Cloud API

Example

Create a client instance

const HetznerCloud = require('hcloud-js')
let client = new HetznerCloud.Client('API_TOKEN')

Build and create a server

client.servers.build('my-awesome-server')
  .serverType('cx11')
  .location('nbg1')
  .image('debian-9')
  .sshKey('work')
  .create()
  .then(function (response) {
    // The response object contains:
    // response.server - The server class instance
    // response.action - The action for creating this server
  })
  .catch(function (error) {
    // Handle error...
  })

Documentation

License

MIT