Implement basic bolt in javascript. Example works as expected