sails.js

Disable request logs in terminal

江枫思渺然 提交于 2020-05-16 04:17:09
问题 Is it possible to turn off sails request logs. Like I'm trying to not see the example pasted below. Because when I run my integration tests, these logs get in the way of the report. <- PUT /api/v1/entrance/login (361ms 200) | The requesting user agent has been successfully logged in. | | Under the covers, this stores the id of the logged-in user in the session as the `userId` key. The next time this user agent sends a request, assuming it includes a cookie (like a web browser), Sails will

Disable request logs in terminal

狂风中的少年 提交于 2020-05-16 04:15:52
问题 Is it possible to turn off sails request logs. Like I'm trying to not see the example pasted below. Because when I run my integration tests, these logs get in the way of the report. <- PUT /api/v1/entrance/login (361ms 200) | The requesting user agent has been successfully logged in. | | Under the covers, this stores the id of the logged-in user in the session as the `userId` key. The next time this user agent sends a request, assuming it includes a cookie (like a web browser), Sails will

NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS

浪尽此生 提交于 2020-04-10 06:51:27
问题 I recently upgraded my computer and with it, to the latest LTS version of Node and NPM: Node.js 8.9.4 NPM 5.6.0 I have a Sails.js 0.12.14 application for which I'm trying to install NPM dependencies with npm install but when I do that, I get the following errors: ➜ web-service git:(feature/auth) ✗ npm install WARN tar ENOENT: no such file or directory, open '/Users/Nag/Code/project/web-service/node_modules/.staging/pako-660dbb41/package.json' WARN tar ENOENT: no such file or directory, open '

NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS

こ雲淡風輕ζ 提交于 2020-04-10 06:51:10
问题 I recently upgraded my computer and with it, to the latest LTS version of Node and NPM: Node.js 8.9.4 NPM 5.6.0 I have a Sails.js 0.12.14 application for which I'm trying to install NPM dependencies with npm install but when I do that, I get the following errors: ➜ web-service git:(feature/auth) ✗ npm install WARN tar ENOENT: no such file or directory, open '/Users/Nag/Code/project/web-service/node_modules/.staging/pako-660dbb41/package.json' WARN tar ENOENT: no such file or directory, open '

Ajax form action not triggered in Sails.js

依然范特西╮ 提交于 2020-03-04 19:38:09
问题 I created an action in Sails.js to create an entry in a database (add a customer). Then I created a form in EJS. (My code is based on the signup route / form) I have my Customer.js models I have my view-create-customer.js I have my create-customer.page.js I have my controller "action" create-customer.js cloud.setup.js has "createCustomer":{"verb":"POST","url":"/api/v1/entrance/create-customer","args":["customerName","status"]} In routes.js I have : 'POST /api/v1/entrance/create-customer': {

How to create a custom route in Sails JS

久未见 提交于 2020-02-25 04:50:26
问题 I'm trying to create a custom route in Sails and according to their documentation, if I add the following in config/routes.js : 'post /api/signin': 'AuthController.index', The request would be dealt with by the index action in the AuthController but that doesn't seems to work at all. When I try the /api/login in Postman, I get nothing back. Please note that I've added restPrefix: '/api' in my config/blueprints.js . Please note I'm using Sails 0.12.x What am I missing here? 回答1: Since you are

Show image immediately after upload in sailsjs

自古美人都是妖i 提交于 2020-02-20 10:54:56
问题 I have form with upload field. After searching for a while, I just put uploaded files to folder ./assets/posts and it worked correctly. In my app, when submit done, it should be reload current url and show new uploaded image. But it didn't. My sails app use linker to manage assets. So after 3 or 4 times I try to reload the page, image is showed. How to show image immediately when I submit done? Thanks a lot! 回答1: Sails uses assets folder to store mainly the assets that are supposed to be

Show image immediately after upload in sailsjs

廉价感情. 提交于 2020-02-20 10:52:09
问题 I have form with upload field. After searching for a while, I just put uploaded files to folder ./assets/posts and it worked correctly. In my app, when submit done, it should be reload current url and show new uploaded image. But it didn't. My sails app use linker to manage assets. So after 3 or 4 times I try to reload the page, image is showed. How to show image immediately when I submit done? Thanks a lot! 回答1: Sails uses assets folder to store mainly the assets that are supposed to be

Compare two fields in Waterline/Sails.js query

安稳与你 提交于 2020-02-06 05:46:06
问题 I want to compare two fields in my Waterline query in Sails.js application, e.g.: SELECT * FROM entity E WHERE E.current < E.max . I've tried the following code, but it's expecting integer value to be passed to it instead of column name: Entity.find({ where: { current: {'<': 'max'} } }); So, how do I compare two columns? 回答1: I have ran some tests and at the same time read the Waterline documentation. There is no indication of anything that could possibly do comparison of two fields/columns

Sails V0.10-rc7 Get a record from the database using REST Blueprints via Socket.IO

自作多情 提交于 2020-02-06 04:02:32
问题 Sails 0.10.0-rc7 Sails Socket IO : Client not receiving response from server. Using sails built in blueprints I am attempting to get information from my server using this functionality. (Im looking to use the default behaviour) Client //Client on different server (localhost:8000) //Sails server var socket = io.connect('http://localhost:1337'); socket.get('/event',function serverSays(err,events){ if (err) console.log(err) console.log(JSON.stringify(events)); }); Server Event Model module