js and a small server for registering events