Skip to content

Proof of concept for using JSX as a server authoring DSL.

Notifications You must be signed in to change notification settings

colshacol/vivien

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vivien

vivien is a 0 dependency prototype Node framework that lets you define the flow of your server using JSX.

import { Vivien } from 'vivien-core'
import Middleware from './Middleware'
import Router from './Router'
import Route from './Route'

import { VersionOneRoute, VersionZeroRoute } from './routes'

const App = (props, context, next) => {
  return (
    <Route match="/api">
      <Route path="/v0" component={VersionZeroRoute} />
      <Route path="/v1" component={VersionOneRoute} />
    </Route>
  )
}

Vivien.listen(App, {
  port: 8080
})

And here is an example of what you might find in ./VersionZeroRoute:

export const VerzionZeroRoute = (props, context, next) => {
  return (
    <Send
      statis={200}
      type="json"
      data={{
        foo: true,
        bar: false
      }}
    />
  )
}

Development

In the case that you'd like to see proof that I build such a misfit of a tool and that it works, you'll wanna do something like this:

# clone the project
[email protected]:colshacol/vivien.git && cd vivien

# install devDependencies (no production dependencies!)
yarn

# start that shit up
yarn develop

About

Proof of concept for using JSX as a server authoring DSL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published