Code Monkey home page Code Monkey logo

Comments (7)

tarlepp avatar tarlepp commented on August 21, 2024

Within frontend side gulp you can do basically following:

  1. gulp serve => raises develop environment (with mini webserver)
  2. gulp dist => make production ready code to dist folder
  3. gulp production => raises production environment (with mini webserver)

So basically you can serve that production code with plain apache / nginx server if you like. Point is to generate 'static' version of your frontend app (html+js+css+images) that you can host where ever you like to.

Within boilerplate sails (backend side) is just an API so it's not supposed to serve any kind of static assets.

I hope this helps.

from angular-sailsjs-boilerplate.

ProLoser avatar ProLoser commented on August 21, 2024

Do both servers have different ports? How do you handle the cross site
security?
On Nov 27, 2014 7:25 AM, "Tarmo Leppänen" [email protected] wrote:

Closed #47
#47.


Reply to this email directly or view it on GitHub
#47 (comment)
.

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

I don't recommend that you use that gulp mini server as in production. Just use what ever webserver you like (apache, nginx, etc.)

But yes both gulp serve and gulp production uses different ports, 3000 and 3001.

from angular-sailsjs-boilerplate.

ProLoser avatar ProLoser commented on August 21, 2024

That wasn't my point. How do you handle the cross site security of making ajax requests from port 3000 to port 1337?

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

Sails has it own CORS setup, by default boilerplate is allowing traffic from all the addresses. Actual API endpoints cannot be accessed without valid JWT token, which is created at the login process.

from angular-sailsjs-boilerplate.

ProLoser avatar ProLoser commented on August 21, 2024

Where is the code for your CORS declaration

from angular-sailsjs-boilerplate.

tarlepp avatar tarlepp commented on August 21, 2024

That configuration can be found in backend config: https://github.com/tarlepp/angular-sailsjs-boilerplate/blob/master/backend/config/cors.js

There is only minor changes on that, comparing to what sails uses as a default. More info about that can be readed there: http://sailsjs.org/#/documentation/reference/sails.config/sails.config.cors.html

from angular-sailsjs-boilerplate.

Related Issues (20)

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.