Skip to content

Coding style #1

@MartinPavlik

Description

@MartinPavlik

Hi, I would like to suggest some improvements of your coding style. Have you considered using some unified coding style such as ES6 or something like that?

Things like the code below are almost impossible to read 👎

var listOfActions = [   createDropFunction("users"),                            createTable("users", createUserTableQuery),
                                            createDropFunction("universal_todos"),      createTable("universal_todos", createUniversalTodoListTableQuery),
                                            createDropFunction("personal_todos"),       createTable("personal_todos", createPersonalTodoListTableQuery),
                                            endClientConnection];
module.exports = {

    mysqlParams         : {
                                          socketPath                    : '/var/run/mysqld/mysqld.sock',
                                          user                          : "user",
                                          password                      : "pw",
                                          database                      : "name",
                                          multipleStatements    : true // allows for multiple queries. consider making this a different connection?
                                        },

    sessionOptions  : {
                                  secret: 'somesecretkeythatweshouldgenerateandstoresomewhere', //TODO make real secret
                                  saveUninitialized: true, // save new sessions
                                          resave: false, // do not automatically write to the session store
                                          cookie : { 
                                                                httpOnly: true, 
                                                                maxAge: 2419200000 
                                                            } // TODO set secure to true when https is used
                                        } 

};

Also consider using 2 spaces for indentation instead of tabs, some other things can be found here.

Otherwise I like this repo and its idea! I can create a pull-request and fix this if you want... 👍

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions