Giter Site home page Giter Site logo

dar-server's Introduction

Dar Server

Node.js based filesystem backend for document archives (Dar). You can find examples here.

Install

$ git clone https://github.com/substance/dar-server.git
$ cd dar-server
$ npm install

Integration into a custom Express application

let express = require('express')
let darServer = require('dar-server')
let path = require('path')

const port = 4000
const rootDir = path.resolve(path.join(__dirname, 'archives'))

let app = express()
darServer.serve(app, {
  port,
  serverUrl: 'http://localhost:' + port,
  rootDir
})

app.listen(port, () => {
  console.log(`Running dar-server on port ${port}`)
})

To avoid name clashes with your own express end-points you can provide an apiUrl

darServer.serve(app, {
  port,
  serverUrl: 'http://localhost:' + port,
  rootDir,
  apiUrl: '/archives'
})

Command-line tool

This module comes with a command-line tool that starts dar-server in a new express instance.

$ npm install -g dar-server
$ dar-server ./my-archives
DAR server is running on http://localhost:4100

To start you could take the examples from the DAR repository:

git clone https://github.com/substance/dar.git

and then start the dar-server using

dar-server ./dar/examples

After that you should be able to open

http://localhost:4100/!list

in the browser and see a listing of found archives. Notice, that dar-server is just a backend for serving archives. To be able to read and edit the context you need to use Texture.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.