Skip to content

Instantly share code, notes, and snippets.

function workflowHasMultipleActiveFacts2() {
var hasMultipleFacts = false;
vm.Workflow.WorkflowItems.forEach(function (w) {
var itemsWithFacts = w.Facts.filter(function (f) { return f.Export })
if (itemsWithFacts.length >= 2) {
hasMultipleFacts = true; return
}
})
Creating a simple REST API server
==================================
This is the simplest way to create a RESTful API server with nodejs. We will create a node server that will use the express module. Then we will define one route/endpoint for the server to act upon. This route will return json data, the prefer data format for RESTful APIs. But note that other data format can be returned too, rest does not enforce this.
Steps:
1. Create a folder to hold our server/project.
2. Create an index.js file as the starting point for our node app/server
3. Add package.json via npm init, you can hit enter for everything and fill them out later
export default class Home extends React.Component {
render() {
var blah = {
"blahprop1": "blahvalue1",
blahprop2: "blahpvalue2",
'blahprop3': 'blahvalue3',
blahprop4: 'blahvalue4',
'blahprop5': "blahvalue5"
}
export default class Home extends React.Component {
render() {
var blah = {
"blahprop1": "blahvalue1",
blahprop2: "blahpvalue2",
'blahprop3': 'blahvalue3',
blahprop4: 'blahvalue4',
'blahprop5': "blahvalue5"
}
var React = require('react');
var Link = require('react-router').Link;
module.exports = React.createClass({
render: function () {
var details = this.props.details;
return (
<div className="col-md-4 col-sm-6 col-xs-6">
<div className="panel">
<span class="upcomingCategory"><Link to="/about">{details.name}</Link></span>
displayEditorDivider: function (key) {
var h = this.tabs[key].showEditorDragDivider;
this.editor.showDragDivider(!!h);
},
<!DOCTYPE html>
<html>
<head>
<title>Renception Editor</title>
</head>
<body>
<div id="main"></div>
</body>
</html>
import React from 'react'
import { render } from 'react-dom'
import HoverSelector from './hoverselector.js'
render(
<div>
<h3>this is a header</h3>
<HoverSelector />
import React from 'react'
import { DropdownButton, MenuItem } from 'react-bootstrap'
class HoverSelector extends React.Component {
constructor: function (props) {
super(props)
},
render: function () {
import React from 'react'
import { DropdownButton, MenuItem } from 'react-bootstrap'
class HoverSelector extends React.Component {
constructor(props) {
super(props)
this.render = this.render.bind(this)
}