{"repo":"anandundavia/express-api-structure","free":true,"listed":false,"github":"https://github.com/anandundavia/express-api-structure","clone":"git clone https://github.com/anandundavia/express-api-structure.git","description":"Structure for Express based API server","language":"JavaScript","stars":117,"topics":["convention","boilerplate","nodejs","expressjs"],"license":null,"category":"saas-starters-boilerplates","readme_excerpt":"Structure src contains the whole source code of the api. Inside src , there are three directories: api , config , constants and one index.js file which will be the entry point to the application constants directory index.js will export all the constants required in the api. - constants which are common across environments like dev and prod should be defined in constants.common.js - constants which are specific for environments should be defined in constants.dev.js or constants.dev.js . Make sure to have the same shape of constants in all the constants.[env].js files DO NOT include sensitive information like credentials of database in the constants, they should be defined in the .env file which is explained config directory This directory will have self-contained config files for different modules in your api. In the boilerplate, express.js and session.js are included which configures the appropriate modules. While creating new config files, in the mind that self-contained config files will help in scaling the application as well as make it more maintainable, For example, If in future you want to shift to sails from express, all you need to do is create one sails.js file, require it in the src/index.js and done! You can even take this to one level further by doing express.dev.js and express.prod.js and require appropriate file in src/index.js based on the env. For the most applications however, that part will be taken care by constants. But if needed, above can be done as well","default_branch":null,"files":null,"tree":[],"storefront":"/r/anandundavia","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/anandundavia/express-api-structure/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}