I need to create a simple database for use in an Angular / Node demo. What is the path of least resistance to adding such a database to my demo?

I need to create a simple database for use in an Angular / Node demo. What is the path of least resistance to adding such a database to my demo?

By the way, I cannot use the MEAN stack.

Edit: I did not mention that I am running the demo from my local environment - from my laptop.

+4
source share
1 answer

The path of least resistance would be to use Sequelizeand sqlite3in your application.

Start by launching npm install sequelize sqlite3.

Then in your code

var Sequelize = require( 'sequelize' )
var connection = Sequelize.connect( undefined, {
  dialect: 'sqlite',
  storage: __dirname + '/db.sqlite'
})

Tada, you have a database connection synchronization with a local SQL block.

, , ".

API angular, json-server - , "".

+3

Source: https://habr.com/ru/post/1584389/