Giter VIP home page Giter VIP logo

sails-generate-backend's Introduction

sails generate backend

Default generator for backend code files in new Sails apps. Creates the default contents of the api/ and config/ folders when you run sails new on the command line.

Branches

Branch Purpose
master The future version of this generator for usewith Sails v1.0.
sails-0.12 The latest stable release of this generator, used by Sails v0.12.x (latest stable as Sep 2016.)

Bugs   NPM version

To report a bug, click here.

This is a built-in module in the Sails command-line tool. It is installed automatically when you run npm install sails -g.

Getting help

Read the docs on generators, and see the support section of our website for more resources.

Contributing

Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.

NPM package info

License

The Sails framework is free and open-source under the MIT License.

sails-generate-backend's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sails-generate-backend's Issues

Default responses methods shouldn`t hide errors in their views

For example, if there is an error in the 500.ejs view then default serverError() should show this one instead of initial error as it does currently.
In this case the developer should first fix his/her 500.ejs to prevent later troubles with it.

To resolve issue for ./responses/serverError.js one can correct callback of res.view() with lines like:

      else {
        sails.log.warn('res.serverError() :: When attempting to render error page view, an error occured (sending JSON instead).  Details: ', err);
      }
-      return res.jsonx(data);
+      if (process.env.NODE_ENV !== 'production') {
+        return res.jsonx(err);
+      }
+      return res.send(500, "Internal Server Error");
}

(In this code data is replaced with err.)

Callbacks of res.view() and res.guessView() in code of other default response methods should be corrected also.

config/connections.js configures default invalid connections for new projects

Within templates/config/connections.js, this file actually defines default connections.

https://github.com/balderdashy/sails-generate-backend/blob/v0.12.4/templates/config/connections.js

These should be commented out by default, especially since most of them require additional npm packages to be installed.

After creating a new project and defining our mongo configuration into config/env/development.js, we kept seeing issues where on sails lift it was attempting to access a mongo server on localhost.

I assume that since these connections are defined here and even though we were not actually using them, on sails lift, it attempts to connect to these.

I would recommend that they be commented out by default and possibly leaving just sails-disk uncommented since this is the default on a new install anyways.

scope.generatorType undefined

Hey,

Not sure exactly how to use this package as I'm still a bit new to Sails. After copying the project to a local directory, I have run:
npm install
node ./bin

but it complains about the scope.generatorType not being set. Where do I set this or do I need to install this generator in a different way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.