Giter VIP home page Giter VIP logo

node-mediawiki-express's Introduction

node-mediawiki-express

NPM

Build Status dependency status dev dependency status

The node mediawiki-express package uses the php-embed package to embed MediaWiki with a node express server.

This is a proof-of-concept for a "single integrated install" of MediaWiki, which will eventually bundle Parsoid and other PHP and JavaScript services into a single server.

We hope to eventually allow easy addition of extensions and skins via npm. See https://phabricator.wikimedia.org/T114457 for more discussion.

USAGE

To start a HTTP server on port 1234:

mediawiki -p 1234

Your wiki will then be found at http://localhost:123/wiki/

API

To customize or extend your MediaWiki server, you can use the JavaScript API.

mwExpress.runServer(options)

Starts an express web server on a specified port, with /w and /wiki routed to a MediaWiki installation. The MediaWiki can be customized via the options parameter.

  • options: an object containing various parameters for the server. All are optional.
    • serverName: the server name to pass to PHP, which will be used as part of MediaWiki's generated URLs. Defaults to localhost.
    • serverPort: the port on which to start the server. Defaults to 8080.
    • localSettingsHook: a JavaScript function which will be invoked at the end of MediaWiki's LocalSettings.php file, and passed PHP's $GLOBALS array as its first parameter. This allows you to customize the settings for the wiki.
    • expressHook: a JavaScript function which will be invoked after the MediaWiki-related routes have been set up on the express app object. It is passed the app object as its first parameter. This allows you to add additional routes to the server before starting it. The / route will be added after expressHook returns (as a redirect to the main page of the wiki), so you can override the / route in this hook if you wish.

INSTALLING

You can use npm to download and install:

  • The latest mediawiki-express package: npm install mediawiki-express

  • GitHub's master branch: npm install https://github.com/cscott/node-mediawiki-express/tarball/master

As a postinstall script, npm will configure mediawiki and create an SQLite database for it to use. It will create an admin account and store its credentials in admin.json for you.

TESTING

Currently npm test only runs a linter. Hopefully in the future we can hook up phantomjs to run the mediawiki test suite.

CONTRIBUTORS

RELATED PROJECTS

  • php-embed: Provides the bidirectional Node<->PHP embedding.
  • php-express: A similar embedding of PHP into a Node.js server, but forks the PHP CLI binary in a separate process instead of embedding PHP.
  • php-cgi: Another implementation forking the php binary and forging a CGI request.

LICENSE

Copyright (c) 2015 C. Scott Ananian.

mediawiki-express is licensed using the same license as mediawiki itself.

node-mediawiki-express's People

Contributors

cscott avatar

Stargazers

Jason Davis avatar Emmanuel Salomon avatar

Watchers

 avatar James Cloos avatar

Forkers

aaronngray

node-mediawiki-express's Issues

Any further work?

I followed the Wikimedia discussion and was disappointed to see it went nowhere. Is there any continuation of this project? It no longer seems to be install-able. Thanks.

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.