![]() These are the main items to highlight on that structure ![]() Notice, the dependencies of the project are not yet installed, only a file structure has been created. This creates a folder called dbximgs with the structure below. In this tutorial, we will use Handlebars, a simplistic template engine that leverages actual HTML instead of developing its own template language. Express uses different types of engines to generate HTML files on the fly before sending them as part of the response, this allows to create HTML content dynamically on each call to the server. For this tutorial, we need support for certain elements of EcmaScript7 (ES7) so I recommend the 8.2.1 version or higher if exists when you read this.Īfter Node is installed in your local environment, we will create a project structure using Express generator, but before that, we need to pick a template engine. ![]() To install Node.JS, you can simply go to and get the latest version. Nonetheless, the Web Service needs some structure and a separation of the back end and the front end code as well as any public resource. The great thing with Node is that you can write server code using JavaScript. For the sake of security (and your trust), we are only using the second (Folder access), so the middleware is only allowed to read/write to a specific folder on the users Dropbox account and nothing else. To do this, users will first authenticate to Dropbox via OAuth, then the middleware will fetch a number of images from a specific folder and render them using a JavaScript library called Galleria.ĭropbox API has two types of permissions, Full Dropbox access or Folder access. The Web Service will allow users to nicely display on a gallery images stored in a Dropbox folder of their own account. These are the main technologies and concepts we will cover: It will show you the artifacts needed to implement a Web Service (which we will also call middleware) that authenticates a user via OAuth with Dropbox to read a user folder, nicely display images in a photo gallery and deploy the code on Heroku for production. In this step by step tutorial we will build a production-ready photo gallery Web Service using Node.JS and Dropbox. Writing a photo gallery Web Service from scratch with Node.JS and Dropbox with production deployment on Heroku
0 Comments
Leave a Reply. |