How to use the @foal/typeorm/node_modules/typeorm.createConnection function in @foal/typeorm

To help you get started, we’ve selected a few @foal/typeorm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FoalTS / foal / packages / examples / src / scripts / create-user.ts View on Github external
export async function main() {
  await createConnection();

  const user = new User();
  user.email = 'john@foalts.org';
  await user.setPassword('password');

  const user2 = new User();
  user2.email = 'mary@foalts.org';
  await user2.setPassword('password2');

  const permission = new Permission();
  permission.name = 'Admin permission';
  permission.codeName = 'admin';

  user.userPermissions = [ permission ];

  console.log(
github FoalTS / foal / packages / examples / src / index.ts View on Github external
async function main() {
  await createConnection(require('../ormconfig.json'));

  const app = createApp(AppController);

  const httpServer = http.createServer(app);
  const port = Config.get('port', 3001);
  httpServer.listen(port, () => {
    console.log(`Listening on port ${port}...`);
  });
}