How to use the @feathersjs/express.urlencoded function in @feathersjs/express

To help you get started, we’ve selected a few @feathersjs/express examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-generic.test-expected / src1 / app.ts View on Github external
// !end

// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
  // !code: helmet_config // !end
));
app.use(cors(
  // !code: cors_config // !end
));
app.use(compress(
  // !code: compress_config // !end
));
app.use(express.json(
  // !code: json_config // !end
));
app.use(express.urlencoded(
  // ! code: urlencoded_config
  { extended: true }
  // !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end

// Set up Plugins and providers
// !code: config_start // !end
github feathersjs-ecosystem / feathers-elasticsearch / test-utils / example-app.js View on Github external
default: 2,
    max: 4
  },
  esVersion: db.getApiVersion(),
  elasticsearch: db.getServiceConfig('todos')
});

// Create a feathers instance.
let app = express(feathers())
  .configure(rest())
  // Enable Socket.io services
  .configure(socketio())
  // Turn on JSON parser for REST services
  .use(express.json())
  // Turn on URL-encoded parser for REST services
  .use(express.urlencoded({ extended: true }))
  .use('/todos', todoService);

module.exports = app;
github feathers-plus / generator-feathers-plus / test / regen-adapters-1.test-expected / src1 / app.js View on Github external
const app = express(feathers());
// !code: use_start // !end

// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end

// Enable security, CORS, compression, favicon and body parsing
app.use(helmet());
app.use(cors());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end

// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());


// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
github feathers-plus / generator-feathers-plus / test / cumulative-1-nedb.test-expected / src1 / app.js View on Github external
const app = express(feathers());
// !code: use_start // !end

// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end

// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end

// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());


// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-2-sequelize-services.test-expected / src1 / app.ts View on Github external
// !end

// Enable security, CORS, compression, favicon and body parsing
app.use(helmet(
  // !code: helmet_config // !end
));
app.use(cors(
  // !code: cors_config // !end
));
app.use(compress(
  // !code: compress_config // !end
));
app.use(express.json(
  // !code: json_config // !end
));
app.use(express.urlencoded(
  // ! code: urlencoded_config
  { extended: true }
  // !end
));
// ! code: use_favicon
// Use favicon
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// !end
// ! code: use_static
// Host the public folder
app.use('/', express.static(app.get('public')));
// !end
// !code: use_end // !end

// Set up Plugins and providers
// !code: config_start // !end
github daffl / websocket-vs-http / lib / app.js View on Github external
const path = require('path');
const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const socketio = require('@feathersjs/socketio');

// Heroku will set the PORT environment variable. Otherwise use 3030
const port = process.env.PORT || 3030;

// Creates an Express compatible Feathers application
const app = express(feathers());

app.use('/', express.static(path.join(__dirname, '..', 'public')));
// Parse HTTP JSON bodies
app.use(express.json());
// Parse URL-encoded params
app.use(express.urlencoded({ extended: true }));
// Add REST API support
app.configure(express.rest());
// Configure Socket.io real-time APIs
app.configure(socketio());
// Register a messages service with pagination
app.use('/messages', {
  async get (id) {
    return { id };
  }
});
// Register a nicer error handler than the default Express one
app.use(express.errorHandler());

// Start the server
app.listen(port).on('listening', () =>
  console.log(`Feathers server listening on localhost:${port}`)
github feathersjs-ecosystem / feathers-86aa6a4d02f6f4a33ba6d428b6283015f5e10ff1 / examples / app.js View on Github external
const blobStore = Store({
  client: s3,
  bucket: 'feathers-blob-store'
});

const blobService = BlobService({
  Model: blobStore
});

// Create a feathers instance.
var app = express(feathers())
  // Turn on JSON parser for REST services
  .use(express.json())
  // Turn on URL-encoded parser for REST services
  .use(express.urlencoded({ extended: true }))
  .use('/blobs', blobService);

// A basic error handler, just like Express
app.use(function (error, req, res, next) {
  res.json(error);
});

// Start the server
module.exports = app.listen(3030);

console.log('feathers-blob-store service running on 127.0.0.1:3030');
github feathers-plus / generator-feathers-plus / examples / ts / 03-authentication / feathers-app / src / app.ts View on Github external
const app = express(feathers());
// !code: use_start // !end

// Load app configuration
app.configure(configuration());
// ! code: init_config
app.set('generatorSpecs', generatorSpecs);
// !end

// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', express.static(app.get('public')));
// !code: use_end // !end

// Set up Plugins and providers
// !code: config_start // !end
app.configure(express.rest());
app.configure(socketio());

// Configure database adapters
app.configure(mongoose);

// Configure other middleware (see `middleware/index.ts`)
app.configure(middleware);
// Set up our services (see `services/index.ts`)
github quasarframework / app-extension-feathersjs / src / templates / server / server-feathers / src / app.js View on Github external
const services = require('./services')
const appHooks = require('./app.hooks')
const channels = require('./channels')

const authentication = require('./authentication')

const app = express(feathers())

// Load app configuration
app.configure(configuration())
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet())
app.use(cors())
app.use(compress())
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(favicon(__dirname + '../../../dist/pwa-mat/statics/icons/favicon-32x32.png'))
// Host the public folder
app.use('/', express.static( __dirname + '../../../dist/pwa-mat' ))

// Set up Plugins and providers
app.configure(express.rest())
app.configure(socketio())

// Configure other middleware (see `middleware/index.js`)
app.configure(middleware)
app.configure(authentication)
// Set up our services (see `services/index.js`)
app.configure(services)
// Set up event channels (see channels.js)
app.configure(channels)
github DefinitelyTyped / DefinitelyTyped / types / feathersjs__express / feathersjs__express-tests.ts View on Github external
const feathersServiceDummy   = {
    get  : () => {
        return Promise.resolve({});
    },
    find : () => {
        return Promise.resolve([{}, {}]);
    }
};
const expressMiddlewareDummy = (req: express.Request, res: express.Response, next: express.NextFunction) => {
    next();
    return app;
};

app.use(express.json());
app.use(express.urlencoded({extended : true}));
app.use('/', express.static('./public'));
app.use('/', expressMiddlewareDummy, feathersServiceDummy);
app.configure(express.rest());
app.use(express.notFound());
app.use(express.errorHandler({logger : console}));