Comments (5)
Oh .. I see .. OK, withBaseUrl
is not so good naming. We should rename it. It should be more like withPrefix
or similar, but it is a breaking change. Maybe after Aurelia v1.0.0 release?
If you want to connect to another host, you must configure sails.io.js
library directly. It is passed as second argument for config function of plugin.
aurelia.use
.plugin('aurelia-sails-socket-client', (sails, io) => {
sails.configure(x => {
io.sails.url = 'http://localhost:9000';
x.withBaseUrl('/api/v1');
});
});
from aurelia-sails-socket-client.
Thanks so much for helping with this, really appreciated.
I had dived into your src and did notice I could append the url to io.sails.url like you have demonstrated
After doing that I didn't think it was right as now after doing that I am getting a connection to the sails server ok but am receiving a CSRF error when trying to post a new todo.
The error in chrome console is now:
Unhandled promise rejection SocketResponseMessage {requestMessage: SocketRequestMessage, statusCode: 403, body: "CSRF mismatch", isSuccess: false, headers: Headers}
This is from the Aurelia App
from aurelia-sails-socket-client.
Yeah, this is little bit complicated. You have to setup your sails app. In your config/csrf.js
make some changes:
module.exports.csrf = {
grantTokenViaAjax: true,
protectionEnabled: true,
origin: 'http://localhost:1337',
routesDisabled: '-'
};
Also CORS should be modified.
from aurelia-sails-socket-client.
Hi Jason,
See #7. Any chance you'd like to share and be a contributor.
John
from aurelia-sails-socket-client.
@Mordred thanks so much for all your assistance. This is working perfectly now as two separate front/end back end solutions. I appreciate all your help.
If you lived in Australia I'd deliberately go out of my way to come and buy you a beer next time I was in your neck of the woods (I travel a bit LOL)
@johntom once I have tidied up my code I'd be happy to help with what I have. As a regular contributor I'm not sure how much value I would be just now. I am just coming into the node world as I have always developed in C#, ASP.NET for our corporate web apps and have in the last 12 months produced two production apps with Meteor (that was a nice experience). I am loving the node ecosystem and LOVE Aurelia and Sails - this is the perfect fit for my next projects and @Mordred's work with this has sealed the deal with me. A lot of the Node/Express/...{WHATEVER MIDDLEWARE} stuff still has me scratching my head.. but I am loving it. - Thanks so much for the offer 👍
from aurelia-sails-socket-client.
Related Issues (11)
- Setup? HOT 2
- Example app runs, but contains no content HOT 1
- Request
- Sails installation HOT 1
- Running example app HOT 3
- Socket HOT 3
- Post message isn't picking up url but picking base url HOT 6
- Cannot lift example in production mode HOT 3
- Separate backend/frontend HOT 1
- disabled autoconnect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurelia-sails-socket-client.