{"id":11156,"date":"2018-06-09T10:12:02","date_gmt":"2018-06-09T08:12:02","guid":{"rendered":"http:\/\/flaven.fr\/?p=11156"},"modified":"2026-09-16T10:07:39","modified_gmt":"2026-09-16T08:07:39","slug":"node-express-mysql-crud-create-a-single-page-application-with-node-ejs-and-mysql","status":"publish","type":"post","link":"https:\/\/flaven.fr\/2018\/06\/node-express-mysql-crud-create-a-single-page-application-with-node-ejs-and-mysql\/","title":{"rendered":"Node, Express, MySQL, CRUD &#8211; Create a Single Page Application with Node, EJS and MySQL"},"content":{"rendered":"<p>Previously, I have made a lot of inquiries to understand how to create an API using Node. I guess, I have satisfied almost all my curiosity and it was the occasion to discover testing.<\/p>\n<p>Nevertheless, 2 questions remain : find a solid alternative to the PHP-MySQL tandem on how to build a rudimentary Single Page Application, find also the way to leverage on MySQL rather than MongoDB.<\/p>\n<p>My reason is easy to guess. It boils down to one word : Legacy. First, I had a lot of MySQL databases, for my personal usage, so having to migrate both code and data may require a harder work. Also, all these MySQL databases can be also queried by some handy other tools such as phpMyAdmin, Sequel Pro or MySQL Workbench.<\/p>\n<p>One other aspect, in the Node&#8217;s API creation that I have neglected so far was how to easily expose data to users through a GUI in a browser. This is the second objective of this post, make more explorations on view engines available in Node or Express to be more precise.<\/p>\n<p>Due mostly of the resources that I have read. It seems that there are 2 popular view engines: EJS, Pug (former named Jade). This is way you expose the data of your node application. Your API outputs JSON, fine, but the content can be wrapped it up with EJS or PUG into GUI (graphical user interface).<\/p>\n<p>Let&#8217;s give a quick definition of &#8220;view engine&#8221;, it is the module that does the actual rendering of views. Pug and EJS are view engines. It will populate the data of your API into true web page.<\/p>\n<p>According to me, EJS seems to be easier for those you have made already HTML integration, it is very similar to Mustache, Smarty or Twig. At the risk of bordering on silliness, with EJS, you just sprinkle variables through HTML files and abuse extensively of includes. Pug has more abstraction in it so it appears less intuitive.<\/p>\n<p><b>The code is available on github at <a href=\"https:\/\/github.com\/bflaven\/node-countries-mysql-crud-ejs\" target=\"_blank\">https:\/\/github.com\/bflaven\/node-countries-mysql-crud-ejs<\/a><\/b><\/p>\n<p>In my example, I have chosen the EJS template engine maybe later I will add to this project the same views but based on PUG (ex Jade). But first, I have decided to create a dead simple Single Page Application with Node, EJS and MySQL.<\/p>\n<h4>Create your MySQL Database<\/h4>\n<p>The purpose is to create an application backed up to a MySQL database. In my example, here is the database name <code>node_countries<\/code> and the table name <code>t_countries<\/code>, some the scheme plus some records.<\/p>\n<pre lang=\"sql\">\r\n\t\r\n\tDROP TABLE IF EXISTS `node_countries`;\r\n\r\nCREATE TABLE `node_countries` (\r\n  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',\r\n  `tld` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',\r\n  `cca2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',\r\n  `capital` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',\r\n  `callingCode` int(3) NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\r\n\r\n\r\nINSERT INTO `node_countries` (`id`, `name`, `tld`, `cca2`, `capital`, `callingCode`)\r\nVALUES\r\n\t(NULL,'Afghanistan','.af','AF','Kabul',93),\r\n\t(NULL,'Italy','.it','IT','Rome',39),\r\n\t(NULL,'France','.fr','FR','Rome',33),\r\n  (NULL,'Malaysia','.my','MY','Kuala Lumpur',60),\r\n  (NULL,'Mauritania','.mr','MR','Nouakchott',222),\r\n  (NULL,'Tunisia','.tn','TN','Tunis',216),\r\n  (NULL,'Tanzania','.tz','TZ','Dodoma',255),\r\n  (NULL,'Seychelles','.sc','SC','Victoria',248),\r\n  (NULL,'Norway','.no','NO','Oslo',47),\r\n  (NULL,'Nepal','.np','NP','Kathmandu',977);\r\n\r\n<\/pre>\n<p><b>The MySQL database<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/03_node_create_a_single_page_application_mysql.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<p><b>Just add the proper values in the configuration file <code>config.js<\/code><\/b><\/p>\n<pre lang=\"javascript\">\r\n\tvar config = {\r\n\tdatabase: {\r\n\t\t\/\/ host:\t  'localhost', \t\t\/\/ database host\r\n\t\thost:\t  '127.0.0.1', \t\t\/\/ database host\r\n\t\tuser: \t  'root', \t\t\t\/\/ your database username\r\n\t\tpassword: 'root', \t\t\t\/\/ your database password\r\n\t\tport: \t  3306, \t\t\t\/\/ default MySQL port\r\n\t\tdb: \t  'node_countries' \/\/ your database name\r\n\t},\r\n\tserver: {\r\n\t\thost:'127.0.0.1', \/\/ the host for the server\r\n\t\tport: '3000' \/\/ the port for the server\r\n\t}\r\n}\r\n\r\nmodule.exports = config\r\n<\/pre>\n<p><b>Start the application, do not forget to start you MySQL instance before typing <code>npm start<\/code><\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/01_node_create_a_single_page_application_start.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<h4>The dead simple application: Node Countries Light Application<\/h4>\n<p>Here some screens captures of the web application. Just to enhance the user experience even for POC, it is nice to add some CSS. Making things ugly make potentials users downhearted even though the development is great! The web application contains 3 main destinations: 1. Homepage, 2. Countries listing where you can edit or delete a single country, 3. Add a new country.<\/p>\n<p><b>1. Homepage at http:\/\/127.0.0.1:3000\/<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/04_node_create_a_single_page_application_screen_1.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<p><b>2. Countries listing at http:\/\/127.0.0.1:3000\/countries with Edit and Delete<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/05_node_create_a_single_page_application_screen_2.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<p><b>3. Add a new country at http:\/\/127.0.0.1:3000\/countries\/add<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/06_node_create_a_single_page_application_screen_3.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<h4>Using APIDOC to add some documentation to your web application<\/h4>\n<p>Even though APIDOC is dedicated to the documentation of an API, why don&#8217;t we leverage on this tool to provide some information about this new web application. You can give detailed information for each action you are coding in your web application via comments in the routes file <code>routes\/countries.js<\/code>.<\/p>\n<pre lang=\"javascript\">\r\n\t\/\/ DELETE COUNTRY\r\n\/**\r\n    * @api {post} \/delete\/(:id) Delete a country\r\n    * @apiGroup Countries\r\n    * @apiSuccess {Number} countries.id Country id\r\n    * @apiParam {String} countries.name Country name\r\n    * @apiParam {String} countries.tld Country tld\r\n    * @apiParam {String} countries.cca2 Country cca2\r\n    * @apiParam {String} countries.capital Country capital\r\n    * @apiParam {Number} countries.callingCode Country callingCode\r\n    * @apiExample {sql} Example usage:\r\n    *       DELETE FROM t_countries t_countries WHERE id = ' + req.params.id\r\n    *\/\r\n<\/pre>\n<p><b>Create the documentation, be sure to be in the directory of your application.<\/b><\/p>\n<pre lang=\"bash\">\r\napidoc -e \"(node_modules|public)\" -o public\/apidoc\r\n<\/pre>\n<p><b>The documentation made with apidoc available at http:\/\/127.0.0.1:3000\/apidoc\/. The output of the delete action in the documentation.<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/07_node_create_a_single_page_application_doc.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<h4>Using Cheerio to make some tests<\/h4>\n<p>I have written some tests with the help of Cheerios to test the 3 main entrances of the web application. Cheerios is a JavaScript library, very powerful to grab HTML element in a page so you can definitely test the presence or the absence of some HTML element.<\/p>\n<p>As the project contains a directory <code>test<\/code> and this directive in the package.json, it will launch any .js file available in the <code>test<\/code> directory with the command <code>npm test<\/code>.<\/p>\n<pre lang=\"javascript\">\r\n\t\"scripts\": {\r\n\t....\r\n    \"test\": \"mocha test\/*.js --timeout 15000\"\r\n  },\r\n<\/pre>\n<p>Check the file <code>test_webpage_1.js<\/code> in the test directory.<\/p>\n<p><b>Run the test<\/b><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/02_node_create_a_single_page_application_test.jpg\" width=\"640\" height=\"480\" alt=\"Node, Express, MySQL, CRUD - Create a Single Page Application with Node, EJS and MySQL\"><\/p>\n<h2>Read more<\/h2>\n<ul>\n<li>NodeJS MySQL pagination example<br \/><a href=\"http:\/\/programmerblog.net\/nodejs-mysql-pagination-example-beginners\/\" target=\"_blank\">http:\/\/programmerblog.net\/nodejs-mysql-pagination-example-beginners\/<\/a><\/li>\n<li>Using MySQL with Node.js and the mysql JavaScript Client<br \/><a href=\"https:\/\/www.sitepoint.com\/using-node-mysql-javascript-client\/\" target=\"_blank\">https:\/\/www.sitepoint.com\/using-node-mysql-javascript-client\/<\/a><\/li>\n<li>Excellent Article &#8211; Node.js, MySQL &#038; Express: Simple Add, Edit, Delete, View (CRUD)<br \/><a href=\"http:\/\/blog.chapagain.com.np\/node-js-express-mysql-simple-add-edit-delete-view-crud\/\" target=\"_blank\">http:\/\/blog.chapagain.com.np\/node-js-express-mysql-simple-add-edit-delete-view-crud\/<\/a><\/li>\n<li>Excellent Article &#8211; Node.js, Express &#038; MySQL: Simple Add, Edit, Delete, View (CRUD)<br \/><a href=\"https:\/\/github.com\/chapagain\/nodejs-mysql-crud\" target=\"_blank\">https:\/\/github.com\/chapagain\/nodejs-mysql-crud<\/a><\/li>\n<li>Create REST-Service with Node.js Express<br \/><a href=\"http:\/\/tabalin.net\/blog\/express-rest-service\" target=\"_blank\">http:\/\/tabalin.net\/blog\/express-rest-service<\/a><\/li>\n<li>ExpressJS and MySQL Sample Application and Tutorial<br \/><a href=\"https:\/\/gistpages.com\/posts\/expressjs_and_mysql_sample_application_and_tutorial\" target=\"_blank\">https:\/\/gistpages.com\/posts\/expressjs_and_mysql_sample_application_and_tutorial<\/a><\/li>\n<li>How To Use MySQL With Node &#038; Express<br \/><a href=\"https:\/\/www.terlici.com\/2015\/08\/13\/mysql-node-express.html\" target=\"_blank\">https:\/\/www.terlici.com\/2015\/08\/13\/mysql-node-express.html<\/a><\/li>\n<li>The Dead-Simple Step-By-Step Guide for Front-End Developers to Getting Up and Running With Node.JS, Express, and MongoDB<br \/><a href=\"https:\/\/closebrace.com\/tutorials\/2017-03-02\/the-dead-simple-step-by-step-guide-for-front-end-developers-to-getting-up-and-running-with-nodejs-express-and-mongodb\" target=\"_blank\">https:\/\/closebrace.com\/tutorials\/2017-03-02\/the-dead-simple-step-by-step-guide-for-front-end-developers-to-getting-up-and-running-with-nodejs-express-and-mongodb<\/a><\/li>\n<li>Building REST API in the blink of an eye! (MySQL + NodeJS)<br \/><a href=\"https:\/\/medium.com\/@avanthikameenakshi\/building-restful-api-with-nodejs-and-mysql-in-10-min-ff740043d4be\" target=\"_blank\">https:\/\/medium.com\/@avanthikameenakshi\/building-restful-api-with-nodejs-and-mysql-in-10-min-ff740043d4be<\/a><\/li>\n<li>Build a Rest API for Node &#038; Mysql 2018 JWT<br \/><a href=\"https:\/\/codeburst.io\/build-a-rest-api-for-node-mysql-2018-jwt-6957bcfc7ac9\" target=\"_blank\">https:\/\/codeburst.io\/build-a-rest-api-for-node-mysql-2018-jwt-6957bcfc7ac9<\/a><\/li>\n<li>Creating a RESTful API with Express js, Node js\/MySQl<br \/><a href=\"https:\/\/arjunphp.com\/creating-restful-api-express-js-node-js-mysql\/\" target=\"_blank\">https:\/\/arjunphp.com\/creating-restful-api-express-js-node-js-mysql\/<\/a><\/li>\n<li>RESTful Api using node.js,Express and Mysql<br \/><a href=\"https:\/\/jinalshahblog.wordpress.com\/2016\/10\/06\/rest-api-using-node-js-and-mysql\/\" target=\"_blank\">https:\/\/jinalshahblog.wordpress.com\/2016\/10\/06\/rest-api-using-node-js-and-mysql\/<\/a><\/li>\n<li>Create a RESTful API using NodeJS and MySQL Database<br \/><a href=\"https:\/\/www.9lessons.info\/2017\/02\/create-restful-api-nodejs-mysql.html\" target=\"_blank\">https:\/\/www.9lessons.info\/2017\/02\/create-restful-api-nodejs-mysql.html<\/a><\/li>\n<li>Curso Node.js: 47. API REST MySQL 1\/5<br \/><a href=\"https:\/\/www.youtube.com\/watch?v=u2FY0lKNlzs\" target=\"_blank\">https:\/\/www.youtube.com\/watch?v=u2FY0lKNlzs<\/a><\/li>\n<li>Simple CRUD Node.js &#038; MySQL<br \/><a href=\"http:\/\/teknosains.com\/i\/simple-crud-nodejs-mysql\" target=\"_blank\">http:\/\/teknosains.com\/i\/simple-crud-nodejs-mysql<\/a><\/li>\n<li>React Server Side Rendering With Node And Express<br \/><a href=\"https:\/\/www.smashingmagazine.com\/2016\/03\/server-side-rendering-react-node-express\/\" target=\"_blank\">https:\/\/www.smashingmagazine.com\/2016\/03\/server-side-rendering-react-node-express\/<\/a><\/li>\n<li>Getting Started with Node, Express and Postgres Using Sequelize<br \/><a href=\"https:\/\/scotch.io\/tutorials\/getting-started-with-node-express-and-postgres-using-sequelize\n\" target=\"_blank\">https:\/\/scotch.io\/tutorials\/getting-started-with-node-express-and-postgres-using-sequelize<br \/>\n<\/a><\/li>\n<li>A proposal for the usage of Sequelize within an Express.JS application.<br \/><a href=\"https:\/\/github.com\/sequelize\/express-example\" target=\"_blank\">https:\/\/github.com\/sequelize\/express-example<\/a><\/li>\n<li>Using Twitter Bootstrap with Node.js, Express and Jade<br \/><a href=\"https:\/\/www.andreagrandi.it\/2013\/02\/24\/using-twitter-bootstrap-with-node-js-express-and-jade\/\" target=\"_blank\">https:\/\/www.andreagrandi.it\/2013\/02\/24\/using-twitter-bootstrap-with-node-js-express-and-jade\/<\/a><\/li>\n<li>Create a todo application using nodejs<br \/><a href=\"http:\/\/www.nascenia.com\/create-a-todo-application-using-nodejs\/\" target=\"_blank\">http:\/\/www.nascenia.com\/create-a-todo-application-using-nodejs\/<\/a><\/li>\n<li>A-node-js-TODO-app-connected-vwith-with-mysql<br \/><a href=\"https:\/\/github.com\/AnweshaPaul12\/A-node-js-TODO-app-connected-vwith-with-mysql\" target=\"_blank\">https:\/\/github.com\/AnweshaPaul12\/A-node-js-TODO-app-connected-vwith-with-mysql<\/a><\/li>\n<li>Node.js + Express &#8211; Tutorial &#8211; PugJS Templating Engine (formerly JADE)<br \/><a href=\"https:\/\/www.youtube.com\/watch?v=DSp9ExFw3Ig\" target=\"_blank\">https:\/\/www.youtube.com\/watch?v=DSp9ExFw3Ig<\/a><\/li>\n<li>Node.JS 101: Querying a Database and Outputting a Dynamic HTML Table with Express and Jade<br \/><a href=\"https:\/\/druckit.wordpress.com\/2014\/05\/28\/node-js-101-querying-a-database-and-outputting-a-dynamic-html-table-with-express-and-jade\/\" target=\"_blank\">https:\/\/druckit.wordpress.com\/2014\/05\/28\/node-js-101-querying-a-database-and-outputting-a-dynamic-html-table-with-express-and-jade\/<\/a><\/li>\n<li>Original AdminLTE translate to node.js + Express + Jade<br \/><a href=\"https:\/\/github.com\/srlopez\/AdminLTExpress\" target=\"_blank\">https:\/\/github.com\/srlopez\/AdminLTExpress<\/a><\/li>\n<li>Express MVC &#8211; Use AdminLTE Template<br \/><a href=\"https:\/\/github.com\/tuananhzippy\/express-mvc-adminlte\" target=\"_blank\">https:\/\/github.com\/tuananhzippy\/express-mvc-adminlte<\/a><\/li>\n<li>How to Use Jade and Handlebars in Express.js<br \/><a href=\"https:\/\/webapplog.com\/jade-handlebars-express\/\" target=\"_blank\">https:\/\/webapplog.com\/jade-handlebars-express\/<\/a><\/li>\n<li>Cheerio, a server side jQuery like tool to help work with HTML in nodejs<br \/><a href=\"https:\/\/dustinpfister.github.io\/2017\/11\/28\/nodejs-cheerio\/\" target=\"_blank\">https:\/\/dustinpfister.github.io\/2017\/11\/28\/nodejs-cheerio\/<\/a><\/li>\n<li>HTML Scraping in NodeJS with Cheerio<br \/><a href=\"http:\/\/dillonbuchanan.com\/programming\/html-scraping-in-nodejs-with-cheerio\/\n\" target=\"_blank\">http:\/\/dillonbuchanan.com\/programming\/html-scraping-in-nodejs-with-cheerio\/<br \/>\n<\/a><\/li>\n<li>February 10 2013<br \/>\nEasy Web Scraping With Node.js<br \/><a href=\"https:\/\/blog.miguelgrinberg.com\/post\/easy-web-scraping-with-nodejs\" target=\"_blank\">https:\/\/blog.miguelgrinberg.com\/post\/easy-web-scraping-with-nodejs<\/a><\/li>\n<li>Scraping data in 3 minutes with Javascript<br \/><a href=\"https:\/\/medium.com\/data-scraper-tips-tricks\/scraping-data-with-javascript-in-3-minutes-8a7cf8275b31\" target=\"_blank\">https:\/\/medium.com\/data-scraper-tips-tricks\/scraping-data-with-javascript-in-3-minutes-8a7cf8275b31<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Previously, I have made a lot of inquiries to understand how to create an API using Node. I guess, I have satisfied almost all my&hellip; <\/p>\n<p class=\"text-center\"><a href=\"https:\/\/flaven.fr\/2018\/06\/node-express-mysql-crud-create-a-single-page-application-with-node-ejs-and-mysql\/\" class=\"more-link\">Continue reading &rarr; <span class=\"screen-reader-text\">Node, Express, MySQL, CRUD &#8211; Create a Single Page Application with Node, EJS and MySQL<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":11165,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"bf_ai_meta_description":"Build a Single Page Application using Node, Express, MySQL, and EJS. Leverage existing MySQL databases for legacy support and efficient querying.","bf_ai_og_title":"Node SPA with MySQL","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3439,3437,3440,3441,3444,3447,3448,3449,3435],"tags":[2427,2424,2429,2398,2430,2428,226,3514,2211,571,2431,2351,2432,795],"class_list":["post-11156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apis-integration","category-business-case-studies","category-cloud-infrastructure","category-data-analytics","category-programming-databases","category-technology-trends","category-tools-productivity","category-tutorials-how-to","category-web-development","tag-apidoc","tag-chai","tag-cheerio","tag-crud","tag-ejs","tag-express","tag-javascript","tag-mongodb","tag-mysql","tag-node","tag-pug","tag-test","tag-view-engines","tag-webapp"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3Vuhl-2TW","jetpack_featured_media_url":"https:\/\/flaven.fr\/wp-content\/uploads\/2018\/06\/node_create_a_single_page_application_b.jpg","_links":{"self":[{"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/posts\/11156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/comments?post=11156"}],"version-history":[{"count":6,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/posts\/11156\/revisions"}],"predecessor-version":[{"id":11170,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/posts\/11156\/revisions\/11170"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/media\/11165"}],"wp:attachment":[{"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/media?parent=11156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/categories?post=11156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flaven.fr\/happy-api\/wp\/v2\/tags?post=11156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}