Sunday, April 30, 2017

Javascript project development with Pow and deployment to Heroku

Serve your project with Pow
Chrome may throw a bunch of errors if you try to run a local JavaScript project just by opening the file(s) in your browser. Third-party library libraries may be blocked due to cross-origin protocol scheme filtering which does not like file://.

One way to get around this is to use Pow to serve the project.

After installing Pow, substitute your project's location following this example:

cd ~/.pow
mkdir soundpound
ln -s /Users/username/projects/soundpound soundpound/public

Deploy to Heroku
When your project's ready to share, deploy it to Heroku!
  1. Create a nodejs project in Heroku
  2. Add heroku/nodejs buildback in Personal apps -> Settings in the Heroku console
  3. Add a package.json file to your application
  4. Push from your git repository to deploy the project to Heroku
Example package.json:

{
  "name": "soundpound",
  "version": "0.1.0",
  "description": "keyboard-driven sound and light show",
  "scripts": {
    "start": "harp server --port $PORT"
  },
  "dependencies": {
    "harp": "*"
  }
}

See https://soundpound.herokuapp.com/

Thursday, March 23, 2017

Maven things

Install library

mvn install:install-file -DgroupId=com.humegatech -DartifactId=car2go-connector -Dversion=1.2.0-SNAPSHOT -Durl=file:./target/ -DupdateReleaseInfo=true -Dfile=./target/car2go-connector-1.2.0-SNAPSHOT.jar

Deploy to local repository
Add repo to pom.xml

...
  <repository>
    <id>local-maven-repo</id>
    <url>file:///${project.basedir}/lib</url>
  </repository>
</repositories>

Deploy
mvn deploy:deploy-file -DgroupId=com.humegatech -DartifactId=car2go-connector -Dversion=1.2.0-SNAPSHOT -Durl=file:./lib/ -DrepositoryId=local-maven-repo -DupdateReleaseInfo=true -Dfile=./lib/car2go-connector-1.2.0-SNAPSHOT.jar

Release Deployment
http://central.sonatype.org/pages/apache-maven.html#performing-a-release-deployment