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

Console.What?!?

How I made a themeable Design System for my Professional Brand — OSKRHQ.DS

Not sure about React? This article to answer your questions

Learning Java Script Basics-Part 2(Loops and Arrays)

How to Validate a CSV File in JavaScript

Dinoloop — REST API Expressjs library for Nodejs powered by Typescript with OOP and SOLID…

Top Features of the Angular 10 Web Development Framework

Dynamic form creation and validation with Vuelidate

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

Parsing site with Node JS

Protect from CSRF attack in Node.js

Introducing the new MongoDB Shell- mongoose

Mongoose