This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://nano-editor.org/dist/v2.2/nano.html#Nanorc-Files | |
syntax "javascript" "\.(js|jsx)$" | |
## Default | |
color white "^.+$" | |
## Decimal, cotal and hexadecimal numbers | |
color brightblue "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h, patch } from "superfine"; | |
const stateful = (comp) => (props) => h("state", { | |
oncreate: (element) => { | |
const statefine = element.$$statefine = {}; | |
statefine.state = {}; | |
statefine.currentProps = props; | |
statefine.selfRender = app(comp, element); | |
statefine.setState = ss => setTimeout(() => statefine.selfRender(statefine.currentProps, statefine.state = ss({ ...statefine.state }), statefine.setState)); | |
statefine.selfRender(props, { ...statefine.state }, statefine.setState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h, patch } from "superfine"; | |
import EvtEmitter from "event-emitter"; | |
const emitter = new EvtEmitter; | |
let readonlyState = { | |
count: 0, | |
text: "" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbstractResource } from "@ritley/core"; | |
import UserModel from "../models/user.model"; | |
import ParseReqBody from "../decorators/req-body-json.decorator"; | |
import ValidateSession from "../decorators/validate-session.decorator"; | |
import { | |
ReqTransformQuery, | |
Dependency, | |
Default, | |
Catch, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbstractResource } from "@ritley/core"; | |
import UserModel from "../models/user.model"; | |
import ParseReqBody from "../decorators/req-body-json.decorator"; | |
import ValidateSession from "../decorators/validate-session.decorator"; | |
import { | |
Dependency, | |
Default, | |
Catch, | |
InternalServerError, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { beforeMethod } from "kaop-ts"; | |
import { | |
BadRequest, | |
ReqTransformBodyAsync | |
} from "@ritley/decorators"; | |
function parseRequestBody(meta) { | |
const [req, res] = meta.args; | |
req.body.then(body => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbstractResource } from "@ritley/core"; | |
import DataService from "../services/database.service"; | |
import UserModel from "../models/user.model"; | |
import SessionModel from "../models/session.model"; | |
import { | |
Dependency, | |
ReqTransformBodyAsync, | |
Default, | |
Catch, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbstractResource } from "@ritley/core"; | |
import SessionModel from "../models/session.model"; | |
import { | |
Default, | |
Catch, | |
MethodNotAllowed, | |
InternalServerError, | |
Created, | |
Unauthorized, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { setAdapter, AbstractResource } = require("@ritley/core"); | |
const Adapter = require("@ritley/standalone-adapter"); | |
setAdapter(Adapter, { | |
"port": 8080 | |
}); | |
class DefaultResource extends AbstractResource { | |
get(req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbstractResource } from "@ritley/core"; | |
import DataService from "../services/database.service"; | |
import UserModel from "../models/user.model"; | |
import { | |
Dependency, | |
ReqTransformBodyAsync, | |
Default, | |
Catch, | |
InternalServerError, |
NewerOlder