Skip to content

Instantly share code, notes, and snippets.

@mschmulen
Last active January 2, 2016 03:09
Show Gist options
  • Save mschmulen/8241887 to your computer and use it in GitHub Desktop.
Save mschmulen/8241887 to your computer and use it in GitHub Desktop.
Customizing StrongLoop git clone https://gist.github.com/8241887.git Customizing-StrongLoop

Adding A Public Static Web Page to your StrongLoop App

  1. Create a LoopBack App slc lb project myApp
  2. cd in your App cd myApp
  3. Copy the static pages into myApp\public folder:
  • Using curl
curl -O http://startbootstrap.com/downloads/stylish-portfolio.zip
unzip stylish-portfolio.zip  && mv stylish-portfolio public && mv public/stylish-portfolio.html public/index.html
  1. comment out the default status uptime as the root handle / by changing app.get('/', loopback.status()); to //app.get('/', loopback.status());
  2. open http://localhost:3000/

##Misc Notes

  • Sometimes the app.js architecture changes, if the above does not work check in the /myApp/moduls/app/index.js for
app.get('/', function getStatus(req, res, next) {
  res.send({
    started: started,
    uptime: (Date.now() - Number(started)) / 1000
  });
});

and change it to /public

  • Using wget
wget -N http://startbootstrap.com/downloads/stylish-portfolio.zip

Creating Custom Model Types

  1. Create a new LoopBack project slc lb project myApp
  2. cd into the application folder cd myApp
  3. Create a custom model slc lb model Product
  4. Create a custom model with a defined schema slc lb model Customer -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment