These are chat archives for jdubray/sam

3rd
Apr 2016
Jean-Jacques Dubray
@jdubray
Apr 03 2016 02:52
Debugging Web Applications has just become a ton easier with server-side #TimeTravel for #SAM #nodejs #javascript https://github.com/jdubray/sam-safe#time-travel
It's that simple to configure:
// Time Travel is initialized in a couple of lines (server-model.js)

var myTimeTraveler = safe.defaultTimeTraveler() ; // or your implementation
safe.initTimeTraveler(myTimeTraveler) ;

// add the express route to access the model versions
myTimeTraveler.init(app,your_path_to_timetravel_snapshots) ;

// SAFE's implements an in memory defaultSnapShotStore, which you can
replace with your own, including a persistent one...

SAFE's defautTimeTravel implementation adds a "Time Travel" component to all state representations so you can easily pick the snapshot you'd like to go back to.

You can also access the time travel store via a simple api:
Return all snapshots: http://localhost:5425/dev/v1/timetravel/snapshots/
Return a single snapshot: http://localhost:5425/dev/v1/timetravel/snapshots/{index}

This message was deleted

Of course SAFE also works on the client (SAFE has no dependency whatsoever).

have fun!

@jdubray good video :+1:
Jean-Jacques Dubray
@jdubray
Apr 03 2016 21:01
npm install sam-safe ...
Jean-Jacques Dubray
@jdubray
Apr 03 2016 21:16
@whitecolor thank you for pointing out cerebraljs, I can see how powerful a SAM based implementation of the cerebral controller would be...