GithubHelp home page GithubHelp logo

article-search's Introduction

toolforge-node-app-base

Base for creating a node.js app hosted on Toolforge, per https://wikitech.wikimedia.org/wiki/Help:Toolforge/Web#node.js_web_services

How to use

  • Git clone this repository and put it in your Toolforge tool's $HOME/www/js directory
  • Write your server application in the server.js file. Remove the boilerplate code that you don't need.
  • Put the static assets in the static directory. These will be served as-is.
  • Modify the package.json file filling in your details. Modify the copyright notice on the LICENSE file.
  • Put your account and toolforge database access credentials in credentials.json, if they're being used.
    • Database access credentials are available from replica.my.cnf file in the tool's $HOME.
    • This file is set to be ignored by git. Either you can create this file directly on the Toolforge host, or you can securely transfer it using scp or rsync (linux/mac) or winscp or pscp (Windows).
  • Run npm run test to test your app locally. This sets up a localhost server on port 3000, which should behave the same way as your tool would on yourtoolname.toolforge.org.
    • Use relative URLs to make any API calls to your tool's backend, and for any static loads of resources, so that they work correctly on the test environment as well.
    • But note that Toolforge database accesses will not work correctly on your local. See this help page to connect to database replicas from your own computer.
  • Run npm run deploy while in Toolforge to start the webservice, or to restart it after a code change.
  • To check the logs of your live application running in the Kubernetes container, enter npm run logs

article-search's People

Contributors

siddharthvp avatar

Watchers

 avatar  avatar

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.