added judge index.js
app now serves static files
added some db initialization
changed function name and export it