Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(app) {
- return function(req, res, next) {
- const body = req.body;
- app.service('users').create({
- email: body.email,
- password: body.password
- })
- // Then redirect to the login page
- .then(user => res.redirect('/login.html'))//this will be a redirect in my client not in the server
- .catch(next);
- };
- };
- module.exports = function() {
- const app = this;
- app.post('/signup', signup(app));// how can I reimplement this with sockets
- app.use(notFound());
- app.use(logger(app));
- app.use(handler());
- };
- request.post(`${SERVER}/signup`)
- .send({ email: username, password: password })
- .then(data=>{console.log(`data comming from response`,data)})
- .catch(error=>{console.log(`ERROR comming from response`,error)})
- import feathers from 'feathers-client';
- const io = require('socket.io-client');
- var socket = io(SERVER);
- let feathersClient =
- feathers()
- .configure(feathers.socketio(socket))
- .configure(feathers.hooks())
- .configure(feathers.authentication({
- storage: window.localStorage
- }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement