Startup

const SpringJS = require("js-spring");
new SpringJS({ name: "test" });

Options

Name

  • Kind: String

  • Example: name: "test"

  • Description: This will be used just for logging purposes

new SpringJS({ name: "test" });

Port

  • Kind: Integer (0-65536)

  • Example: port: 8080

  • Description: What port to run the web server on

We suggest port 8080 for development but you are free to use any port number between 0 and 65536

Log

  • Kind: Boolean

  • Example: log: true

  • Description: Whether or not to log requests to the console

Mongo

  • Kind: String

  • Example: mongo: "mongodb://localhost:27017/"

  • Description: Mongo server to connect to your database

Routes

  • Kind: Array

  • Example: routes: [{ url:'/', router: require('./api.js') }]

  • Description: For assigning routes to your application.

Views Directory

  • Kind: String

  • Example: viewsDir: "./test/views"

  • Description: The views directory

We recommend this option only if you are setting a view engine like ejs or pug

Public Directory

  • Kind: String

  • Example: publicDir: "./test/views"

  • Description: The public directory for express

Last updated

Was this helpful?