Set a Canonical URL in Node.JS

npm install cloudmersive-convert-api-client --save
"dependencies": {
"cloudmersive-convert-api-client": "^2.6.3"
}
var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveConvertApiClient.EditHtmlApi();var canonicalUrl = "canonicalUrl_example"; // String | The HTML canonical URL to set.var opts = {
'inputFile': Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer), // File | Optional: Input file to perform the operation on.
'inputFileUrl': "inputFileUrl_example" // String | Optional: URL of a file to operate on as input.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.editHtmlHtmlSetRelCanonical(canonicalUrl, opts, callback);

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

QR Code and Barcode Reader App using React Native Expo

Functions in Javascript

The Language Hub — Netlify x Hashnode Hackathon

Creating a Radio Button Component in React

Day 110 — Setting up a Sword Arc Animation Effect

All about JavaScript — The language of love indeed.

Frontend Weekly Digest #153 (6–12 April 2020)

Node.js Framework Series — 1.2.5. NestJS — Interceptor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

How to Dockerize a NodeJs Application 🐳

nodejs docker app

How To Use node-cron to Run Recurring Tasks in Node.js

Back-end Concepts

Exploring Microservices with Node.js: Benefits & 6 Best Practices