Posts

Deploy Spark webapp (java app) on Heroku...

Deploy Spark webapp (java app) on Heroku... // /src/main/java/Main.java import static spark . Spark .*; import java.util.Optional ; import spark.Spark ; public class Main { public static void main ( String [] args ) { // set port Optional . ofNullable ( System . getProperty ( "heroku.port" )) . map ( Integer: : parseInt ) . ifPresent ( Spark: : port ); get ( "/" , ( req , res ) -> "HELLO WORLD" ); } } // build.gradle plugins { id 'java' id 'application' } repositories { jcenter () } mainClassName = 'Main' installDist . destinationDir = file ( 'target' ) dependencies { compile 'com.sparkjava:spark-core:2.8.0' } task install ( dependsOn: [ installDist ]) { doLast { def libdir = file ( new File ( installDist . destinationDir , 'lib' )) def deps = libdir ....

How i'm Using the http-server for the web-development needs

i switched from lr-http-server to  live-server  .  live-server.js const liveServer = require( 'live-server' ), fs = require( 'fs' ), Path = require( 'path' ), module_exists = require( 'module-exists' ), chalk = require( 'chalk' ), stream = require( 'stream' ), execution_time = require( 'execution-time' )(), Optional = require( 'optional-js' ), browserify = require( 'browserify' ); const params = { port : 8181 , // Set the server port. Defaults to 8080. host : 'localhost' , // Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP. root : './dist' , // Set root directory that's being served. Defaults to cwd. open : true , // When false, it won't load your browser by default. ignore : 'scss,pug,vendor' , // comma-separated string for paths to ignore // file: "index.html", // When...