javascript - Adding prefix in all controllers & services in sails -


New to Hi Node & amp; Sail and at the same time, there are some criteria in my code. Sales is currently in JS, for example

  API / Controller / Test Controller JS Services / Test Services JS:   

Most of the time, I only use the URL format as seen:

  http: // localhost / test / http: // localhost / test / & Lt; Action & gt;   

If I add some prefix to my filename, then it will be like this:

  API / Controller / Prefect controller JS Services / Protest Services JS   

The URL must be accessed correctly:

  http: // localhost / prtest / http: // localhost / prtest / & lt; Action & gt;   

Question:

1) If I add prefix for all my controllers & amp; Service file name, can this URL access:
  http: // localhost / test / http: // localhost / test /   

without adding the prefix?

I was thinking of configing config / routes.js to get it by editing something like this:

  '/ test': {controller : 'Preet Controller', Action: '& lt; Action & gt; ' }, '/ Test / *': {Controller: 'Pretext Controller'}   

Honestly, I have not tried it yet (before I make major changes to my code I can mess it up)

2) Is it possible sails.js
  PrtestController.js> Prtestcontroller.js   

Thanks in advance!

Modified Question

Using Default Cell Config for Value Controllers of BTW I:

  blueprints: {actions: true, Example: (My routes. Js will be 'Pre-Test Controller: Action 2', '/ Test / Action 3 ':' Pre Test Controller: Action 3 ',' PT Test Controller ',' / Test / Action 2 '' PrTestController: Action4 ',' / test / action5 ':' prTestController: action5 ',' / test / action6 ':' PrTestController: action6 ',' / test / action7 ':' prTestController: action7 ' Pitestra Controller: Action 8 ',' / Test / Action 9 ':' Pre Test Controller: Action 9 '. Is it possible for routes if the URL /  

For # 2, yes, this is what I mean.

Thanks a lot!

/ div>

<

  • Em>. - If your controller's name is PrtestController , then (if activated) then blueprints themselves Alit that will set a path for you host / prtest / . To override it, turn blue print off, and add some custom routes.

    If you are having difficulty understanding the magic in seal, then I suggest that you close all blueprints or at least play with different settings, you can manually You have to configure the routes and tasks from when you know what blueprints do and the reason for this is to turn it back on if you want to use it.

    Blueprints and routes have been explained in more detail here.

  • Not sure what you say. Do you wonder if lowercase control names are allowed? If yes, then yes, this should not be a problem.

  • Comments

    Popular posts from this blog

    Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

    multithreading - PhantomJS-Node in a for Loop -

    c++ - MATLAB .m file to .mex file using Matlab Compiler -