New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

generator-simple-reactapp-gulp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-simple-reactapp-gulp

Simple generator for creating ReactApp

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

generator-simple-reactapp-gulp

Simple generator for creating ReactApp

yeoman:   http://yeoman.io/
react:   https://facebook.github.io/react/
redux:   http://redux.js.org/

Configuration

The generator includes a framework Hapi

const Hapi = require('hapi');
const Inert = require('inert');
const Vision = require('vision');
const Handlebars = require('handlebars');
const path = require('path');
const logger = require('pino')();

// routes
const routs = require('./routes');

const server = new Hapi.Server();

server.connection({
  port: process.env.PORT || 5000,
  routes: {
    cors: true,
  },
});

server.register([Inert, Vision], () => {});

server.views({
  engines: { html: Handlebars },
  path: path.resolve(__dirname, './templates'),
});

server.route(routs);

server.start((err) => {
  if (err) {
    throw err;
  }
  logger.info('Server running at:', server.info.uri);
});

routes

module.exports = [
  {
    method: 'GET',
    path: '/js/{param*}',
    handler: {
      directory: {
        path: './public/js',
        redirectToSlash: true,
        index: true,
      },
    },
  },
  {
    method: 'GET',
    path: '/css/{param*}',
    handler: {
      directory: {
        path: './public/css',
        redirectToSlash: true,
        index: true,
      },
    },
  },
  {
    method: 'GET',
    path: '/img/{param*}',
    handler: {
      directory: {
        path: './public/img',
        redirectToSlash: true,
        index: true,
      },
    },
  },
  {
    method: 'GET',
    path: '/fonts/{param*}',
    handler: {
      directory: {
        path: './public/fonts',
        redirectToSlash: true,
        index: true,
      },
    },
  },
  {
    method: 'GET',
    path: '/media/{param*}',
    handler: {
      directory: {
        path: './public/media',
        redirectToSlash: true,
        index: true,
      },
    },
  },
  {
    method: 'GET',
    path: '/{path*}',
    handler: (request, reply) => {
      reply.view('index');
    },
  },
];

Usage:

Install

yo simple-reactapp-gulp

Start developer server

npm start

Production build

npm run build

Build Docker container

npm run buildContainer

Keywords

FAQs

Package last updated on 15 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc