{"id":601863,"date":"2020-06-02T12:10:21","date_gmt":"2020-06-02T10:10:21","guid":{"rendered":"https:\/\/www.devoteam.com\/expert-view\/hosting-a-website-with-a-mulesoft-application\/"},"modified":"2020-06-02T12:10:21","modified_gmt":"2020-06-02T10:10:21","slug":"hosting-a-website-with-a-mulesoft-application","status":"publish","type":"expert-view","link":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/","title":{"rendered":"Hosting A Website With A MuleSoft Application"},"content":{"rendered":"<p>\u00a0<\/p>\n<p>One of the really interesting features of MuleSoft is that you can use a <a href=\"https:\/\/nl.devoteam.com\/integration-technology-consulting-with-mulesoft\/\" target=\"_blank\" rel=\"noopener\">MuleSoft<\/a> application to package and host website content. You package your website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and your website is published and accessible to the end users. In this blog I will give you an example scenario of how it&#8217;s done so, you can use it for your own needs.<\/p>\n<p>Imagine you are doing file transfers with MuleSoft and your target location is not always accessible. You have an option to move files in a temporary location and retry at later point in time. While you can automate all of this, sometimes your customers would like a little bit more flexibility and control around retrying and clear visibility into what has not been yet transferred successfully.<\/p>\n<p>You can create simple web page that list all of the files that are not transferred successfully with details such as name, size, date, etc. You can then be creative with your HTML and features to give your customer the best experience. For example: option to retry one, multiple or all of the files from the temporary location through this web page.<\/p>\n<p>Before we proceed, you can spin a local SFTP server for test purposes. I use portable Rebex Tiny SFTP<br \/>Server which is free of charge: <a href=\"https:\/\/labs.rebex.net\/tiny-sftp-server\">https:\/\/labs.rebex.net\/tiny-sftp-server<\/a><\/p>\n<p>Test your SFTP connection using tools like WinSCP: <a href=\"https:\/\/winscp.net\/eng\/download.php\">https:\/\/winscp.net\/eng\/download.php\u00a0<\/a><\/p>\n<p>Create new Mulesoft application in Anypoint Studio. Then, create a new folder under <em>src\/main\/resources<\/em><br \/>and call it for example <em>\u201cweb\u201d<\/em>. Drop all your website files in there: html, js, css.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81110\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/1-1-2.png\" alt=\"\" width=\"369\" height=\"398\" \/><\/p>\n<p><strong>Flow 1:<\/strong><\/p>\n<p>In your main flow xml file you first need to load your static resources. For this you need one HTTP Listener and one HTTP Load Static Resource handler (You can find both under the HTTP module in palette).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81111\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/2-1-1.png\" alt=\"\" width=\"361\" height=\"267\" \/><\/p>\n<p>You will need to create a HTTP Listener Configuration. Default settings will suffice for this exercise. You also need to setup the path \u2013 this is how you want to access your page. Please see the examples below:<\/p>\n<p><a href=\"http:\/\/localhost:8081\/index.html\">http:\/\/localhost:8081\/index.html<\/a> or <a href=\"http:\/\/localhost:8081\/web\/index.html\">http:\/\/localhost:8081\/web\/index.html<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81112\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/3-1-2.png\" alt=\"\" width=\"489\" height=\"290\" \/><\/p>\n<p>After this you configure a Load Static Resources handler.<\/p>\n<p>Pay attention to:<\/p>\n<ul>\n<li><em>Resource base path<\/em>: recognize \u201c<em>web<\/em>\u201d folder we created under <em>src\/main\/resources<\/em> in the first step.<\/li>\n<li><em>Default file<\/em>: This is the file that will load automatically when you access the base path of your HTTP listener that you created earlier. For example:<\/li>\n<\/ul>\n<p><a href=\"http:\/\/localhost:8081\">http:\/\/localhost:8081<\/a> or <a href=\"http:\/\/localhost:8081\/web\/\">http:\/\/localhost:8081\/web\/<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81113\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/4-2-1.png\" alt=\"\" width=\"515\" height=\"248\" \/><\/p>\n<p><strong>Flow 2<\/strong><\/p>\n<p>To access your remote directory and list the files, we will expose the HTTP listener in combination with a SFTP List operation. We basically create an API which we can invoke from our website.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81114\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/5-2-1.png\" alt=\"\" width=\"445\" height=\"257\" \/><\/p>\n<p>You can configure the HTTP listener something like below (pay attention to the Path):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81115\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/6-1-1.png\" alt=\"\" width=\"437\" height=\"299\" \/><\/p>\n<p>Next, you configure the SFTP List handler (pay attention to Directory Path). You also need to create a new SFTP Configuration with your SFTP host, port, username, and password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81116\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/7-1-1.png\" alt=\"\" width=\"518\" height=\"310\" \/><\/p>\n<p>Lastly, you may need to transform data to your desired format and that\u2019s all.<\/p>\n<p>Now you can test your flow and website. Drop a couple of files in your SFTP location, run your MuleSoft application, and navigate to your website base path to see your website running within your MuleSoft application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-81117\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/8-1-1.png\" alt=\"\" width=\"1609\" height=\"927\" \/><\/p>\n<p>I hope that you found this useful. <strong>Enjoy practicing!<\/strong><\/p>\n<h2>Do you have issues with Anypoint Studio or other MuleSoft Application solutions?<\/h2>\n<p>If you have any problems regarding <a href=\"https:\/\/nl.devoteam.com\/integration-technology-consulting-with-mulesoft\/\" target=\"_blank\" rel=\"noopener\">MuleSoft solutions<\/a> or other integration-related challenges, <a href=\"https:\/\/nl.devoteam.com\/get-in-touch\/\" target=\"_blank\" rel=\"noopener\">get in touch!<\/a><\/p>\n<p>\u00a0<\/p>\n\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 One of the really interesting features of MuleSoft is that you can use a MuleSoft application to package and host website content. You package your website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and your website is published and accessible to the end users. In this blog I [&hellip;]<\/p>\n","protected":false},"featured_media":352977,"template":"","categories":[],"tags":[3365,2430,3334,3368,2717],"industry":[],"class_list":["post-601863","expert-view","type-expert-view","status-publish","has-post-thumbnail","hentry","tag-api-en-nl","tag-business-platforms-en-nl","tag-integration-en-nl","tag-mulesoft-en-nl","tag-netherlands-en-nl"],"acf":[],"cards":"\n\t<div class=\"single-post-card\">\n\n\t\t<figure class=\"wp-block-post-featured-image\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/\" target=\"_self\" ><img width=\"2560\" height=\"1707\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"Hosting A Website With A MuleSoft Application\" style=\"aspect-ratio:4\/3;width:100%;object-fit:cover;\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg 2560w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-300x200.jpg 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-1024x683.jpg 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-768x512.jpg 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-1536x1024.jpg 1536w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-2048x1366.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/a><\/figure>\n\n\t\t\n\t\t<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-43282307 wp-block-group-is-layout-flex\">\n\t<p style=\"font-style:normal;font-weight:700\" class=\"has-link-color wp-elements-1 wp-block-lp-post-type has-text-color has-primary-color has-small-font-size\">Expert View<\/p>\n\n\t\t\n\t\t<h3 style=\"font-style:normal;font-weight:400\" class=\"wp-block-post-title has-base-font-size\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/\" target=\"_self\" >Hosting A Website With A MuleSoft Application<\/a><\/h3><\/div>\n\t\t\n\t<\/div>\n\n","yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Hosting A Website With A MuleSoft Application | Devoteam<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hosting A Website With A MuleSoft Application\" \/>\n<meta property=\"og:description\" content=\"\u00a0 One of the really interesting features of MuleSoft is that you can use a MuleSoft application to package and host website content. You package your website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and your website is published and accessible to the end users. In this blog I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/\" \/>\n<meta property=\"og:site_name\" content=\"Devoteam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/\",\"name\":\"Hosting A Website With A MuleSoft Application | Devoteam\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/gray-metal-hand-railings-1888883-scaled-1.jpg\",\"datePublished\":\"2020-06-02T10:10:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/#breadcrumb\"},\"inLanguage\":\"en-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NL\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/#primaryimage\",\"url\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/gray-metal-hand-railings-1888883-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/gray-metal-hand-railings-1888883-scaled-1.jpg\",\"width\":2560,\"height\":1707},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/hosting-a-website-with-a-mulesoft-application\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expert View\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Hosting A Website With A MuleSoft Application\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\",\"name\":\"Devoteam\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-NL\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Hosting A Website With A MuleSoft Application | Devoteam","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/","og_locale":"en_US","og_type":"article","og_title":"Hosting A Website With A MuleSoft Application","og_description":"\u00a0 One of the really interesting features of MuleSoft is that you can use a MuleSoft application to package and host website content. You package your website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and your website is published and accessible to the end users. In this blog I [&hellip;]","og_url":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/","og_site_name":"Devoteam","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/","url":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/","name":"Hosting A Website With A MuleSoft Application | Devoteam","isPartOf":{"@id":"https:\/\/devoteam.info\/en-nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/#primaryimage"},"image":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/#primaryimage"},"thumbnailUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg","datePublished":"2020-06-02T10:10:21+00:00","breadcrumb":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/#breadcrumb"},"inLanguage":"en-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/"]}]},{"@type":"ImageObject","inLanguage":"en-NL","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/#primaryimage","url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg","contentUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg","width":2560,"height":1707},{"@type":"BreadcrumbList","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/hosting-a-website-with-a-mulesoft-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devoteam.info\/en-nl\/"},{"@type":"ListItem","position":2,"name":"Expert View","item":"https:\/\/devoteam.info\/en-nl\/expert-view\/"},{"@type":"ListItem","position":3,"name":"Hosting A Website With A MuleSoft Application"}]},{"@type":"WebSite","@id":"https:\/\/devoteam.info\/en-nl\/#website","url":"https:\/\/devoteam.info\/en-nl\/","name":"Devoteam","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devoteam.info\/en-nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-NL"}]}},"uagb_featured_image_src":{"full":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1.jpg",2560,1707,false],"thumbnail":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-150x150.jpg",150,150,true],"medium":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-768x512.jpg",768,512,true],"large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-1536x1024.jpg",1536,1024,true],"2048x2048":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gray-metal-hand-railings-1888883-scaled-1-2048x1366.jpg",2048,1366,true]},"uagb_author_info":{"display_name":"Julien Pawlowski","author_link":"https:\/\/devoteam.info\/en-nl\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"\u00a0 One of the really interesting features of MuleSoft is that you can use a MuleSoft application to package and host website content. You package your website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and your website is published and accessible to the end users. In this blog I&hellip;","_links":{"self":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view"}],"about":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/types\/expert-view"}],"version-history":[{"count":0,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media\/352977"}],"wp:attachment":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media?parent=601863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/categories?post=601863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/tags?post=601863"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/industry?post=601863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}