Skip to content

Instantly share code, notes, and snippets.

View yohangz's full-sized avatar

Yohan Gomez yohangz

View GitHub Profile
package controllers
import javax.inject._
import play.api.Configuration
import play.api.http.HttpErrorHandler
import play.api.mvc._
/**
* Frontend controller managing all static resource associate routes.
package controllers
import javax.inject._
import play.api.Configuration
import play.api.http.HttpErrorHandler
import play.api.mvc._
/**
* Frontend controller managing all static resource associate routes.
@yohangz
yohangz / dir
Last active February 1, 2018 11:57
├── /app/ # The backend source (controllers, models, services)
│ └── /controllers/ # Backend controllers
│ └── FrontendController.scala # Asset controller wrapper serving frontend assets and artifacts
├── /conf/ # Configurations files and other non-compiled resources (on classpath)
│ ├── application.conf # Play application configuratiion file.
│ ├── logback.xml # Logging configuration
│ └── routes # Routes definition file
├── /logs/ # Log directory
│ └── application.log # Application log file
├── /project/ # Contains project build configuration and plugins
@yohangz
yohangz / routes
Last active February 1, 2018 11:50
Play react routs file
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Serve index page from public directory
GET / controllers.FrontendController.index()
# An example route (Prefix all API routes with apiPrefix defined in application.conf)
GET /api/summary controllers.HomeController.appSummary
@yohangz
yohangz / ui-build.sbt
Last active March 18, 2019 07:41
Play react seed UI build
import scala.sys.process.Process
/*
* UI Build hook Scripts
*/
// Execution status success.
val Success = 0
// Execution status failure.
@yohangz
yohangz / FrontendRunHook.scala
Last active March 27, 2019 05:41
Play react seed frontend run hook
import play.sbt.PlayRunHook
import sbt._
import scala.sys.process.Process
/**
* Frontend build play run hook.
* https://www.playframework.com/documentation/2.7.x/SBTCookbook
*/
object FrontendRunHook {
@yohangz
yohangz / FrontendCommands.scala
Created December 20, 2017 07:54
Play react seed frontend comands
/**
* Frontend build commands.
* Change these if you are using some other package manager. i.e: Yarn
*/
object FrontendCommands {
val dependencyInstall: String = "npm install"
val test: String = "npm run test"
val serve: String = "npm run start"
val build: String = "npm run build"
}
@yohangz
yohangz / package.json
Created December 20, 2017 07:44
React Create App package.json modification
{
...
"scripts": {
...
"build": "rimraf ../public && react-scripts build && ncp build ../public && rimraf build",
...
},
...
"proxy": "http://localhost:9000",
...
@yohangz
yohangz / FrontendCommands.scala
Last active July 19, 2018 05:19
Frontend commands object
/**
* Frontend build commands.
* Change these if you are using some other package manager. i.e: Yarn
*/
object FrontendCommands {
val dependencyInstall: String = "npm install"
val test: String = "npm run test:ci"
val serve: String = "npm run start"
val build: String = "npm run build:prod"
}
@yohangz
yohangz / FrontendRunHook.scala
Last active March 27, 2019 05:41
Play frontend build run hook
import play.sbt.PlayRunHook
import sbt._
import scala.sys.process.Process
/**
* Frontend build play run hook.
* https://www.playframework.com/documentation/2.7.x/SBTCookbook
*/
object FrontendRunHook {