Skip to content

OKNoah/final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Final

Master repo for Final-related packages.

  • final-server - Package for creating and running apps with the Final framekwork
  • final-arango - Decorator for adding database functionality to Final
  • arangolize - The query-builder used in final-arango

Quick intro

Examples here

Tests here

Simple example:

import Final, { createServer } from 'final-server'
import database from 'final-arango'
import { UserSchema } from './data-model'

@database({
  collection: 'FinalUser'
})
class User extends Final.Component {
  path = '/user/:user?'
  schema = UserSchema
  uniques = ['email']

  async get () {
    const user = await this.findOne({
      where: { name: this.props.params.user }
    })

    return user
  }

  async post () {
    const user = await this.save(this.props.body)

    return user
  }
}

createServer({
  components: [User],
  port: process.env.PORT || 3001
})

See the final-server folder for more.