Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a data server retrieval sample #2

Open
bgaillard opened this issue Jun 16, 2015 · 2 comments
Open

Implement a data server retrieval sample #2

bgaillard opened this issue Jun 16, 2015 · 2 comments

Comments

@bgaillard
Copy link
Member

Implement a server side rendering sample which retrieves data from a database, because the sample should be light we could do it using one of those DB / libraries :

@bgaillard bgaillard changed the title Implement a data retrieval sample Implement a data server retrieval sample Jun 16, 2015
@dottodot
Copy link

Yes an example using data would be great as I'm a little unsure what the best approach would be. I've not had a play around with it yet but i'm guessing you would load your data into the views on the server side routes. This is something I'd typically do in my front end controller so would you leave that in place or remove it.

@bgaillard
Copy link
Member Author

Hi @dottodot, I implemented a first very simple sample yesterday.

This sample uses node-sqlite3 and can be accessed at http://localhost:3000/frameworks/1.

Please take a look at the following files and directories

  • src/data contains test data
  • src/js/db.js reads the data and initialize an SQLite3 db with those data
  • src/js/dal contains only data mappers for now
  • src/js/service contains business services

I'll improve this later when i'll have more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants