Skip to content

Commit f1526e1

Browse files
authored
Update README.md
1 parent 365518a commit f1526e1

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

README.md

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,64 +39,60 @@ Please note that this library is still under development. Although it's function
3939
<h2>Usage</h2>
4040

4141
<p>The Cloudways JS Client library makes it easy to interact with the Cloudways API for various operations. Below are some examples to help you get started.</p> <h3>Initializing the API</h3>
42-
<p>Before performing any operations, initialize the API with your Cloudways account credentials:</p>
43-
<div class="code-title">JavaScript:</div>
44-
<pre><code>import { initializeCloudwaysApi } from 'cloudways-js-client';
42+
<p>Before performing any operations, initialize the API with your Cloudways account credentials:</p>
43+
44+
```javascript
45+
import { initializeCloudwaysApi } from 'cloudways-js-client';
4546

4647
const email = 'your_email@example.com'; // Replace with your Cloudways account email
4748
const apiKey = 'your_api_key'; // Replace with your Cloudways API key
4849

4950
initializeCloudwaysApi(email, apiKey);
50-
</code></pre>
51-
51+
```
5252
<h3>Deleting a Server</h3>
5353
<p>To delete a server, use the <code>deleteServer</code> function. Ensure you have the correct server ID:</p>
54-
<div class="code-title">JavaScript:</div>
5554

56-
<pre><code>import { deleteServer } from 'cloudways-js-client';
55+
```javascript
56+
import { deleteServer } from "cloudways-js-client";
5757

5858
async function deleteServerA() {
5959
const serverId = 12345; // Replace with the server ID you want to delete
6060
await deleteServer(serverId);
61-
console.log('Server deleted successfully.');
61+
console.log("Server deleted successfully.");
6262
}
63-
</code></pre>
63+
```
6464

6565
<h3>Getting the List of Servers</h3>
6666
<p>You can retrieve the list of servers associated with your account using the <code>getServersList</code> function:</p>
67-
<div class="code-title">JavaScript:</div>
68-
<pre><code>import { getServersList } from 'cloudways-js-client';
67+
68+
```javascript
69+
import { getServersList } from "cloudways-js-client";
6970

7071
async function listServers() {
71-
try {
72-
const servers = await getServersList();
73-
console.log('Servers List:', servers);
74-
} catch (error) {
75-
console.error('Error fetching servers list:', error);
76-
}
72+
try {
73+
const servers = await getServersList();
74+
console.log("Servers List:", servers);
75+
} catch (error) {
76+
console.error("Error fetching servers list:", error);
77+
}
7778
}
7879

7980
listServers();
80-
</code></pre>
81-
82-
<h3>Combining Operations</h3>
83-
<p>You can combine these functions to perform multiple operations. For example, to delete a server and then get the updated list of servers:</p>
84-
<div class="code-title">JavaScript:</div>
85-
86-
<pre><code>
87-
```javascript
81+
```
8882

89-
async function deleteServerAndGetList() {
83+
<h3>Combining Operations</h3>
84+
<p>You can combine these functions to perform multiple operations. For example, to delete a server and then get the updated list of servers:</p>
9085

91-
const serverId = 12345; // Replace with the server ID to delete
92-
await deleteServer(serverId);
93-
console.log('Server deleted successfully.');
94-
console.log('Updated Servers List:', await getServersList());
86+
```javascript
87+
async function deleteServerAndGetList() {
88+
const serverId = 12345; // Replace with the server ID to delete
89+
await deleteServer(serverId);
90+
console.log("Server deleted successfully.");
91+
console.log("Updated Servers List:", await getServersList());
9592
}
9693

9794
deleteServerAndGetList();
9895
```
99-
</code></pre>
10096

10197
<h2>Issues</h2>
10298

0 commit comments

Comments
 (0)