Git Product home page Git Product logo

queue's Introduction

queue

Running locally in dev mode:

  • Clone the repository
  • Install node and npm
  • Install sqlite3: npm install sqlite3 in the queue directory
  • Install dependencies: npm install in the queue directory
  • In models/index.js, uncomment sequelize.sync({force: true})
    • Comment this line after the first run if you do not want databases to be dropped and rebuilt on startup
  • Start the server: npm run dev
    • Access the queue from a browser at localhost:3000

Multiple users in dev mode

In production, all auth is done my Shibboleth, and we just read out of the eppn header to get a student's identity. In dev mode, we still want to be able to test with multiple users (for instance, to assert that user roles work correctly, or to ensue that syncing between multiple clients works correctly). To achieve that, we use express-session to track users across page reloads. By default, you will assume the role of dev, an admin user. To force a different user, you can append ?forceuser=NETID to any URL (this creates a user NETID if needed). All future requests from that browser will be associated with that user, and you can add it to course staff, etc. like a normal user.

To test with multiple users at the same time, you can open up multiple browsers, or use multiple incognito windows.

Production config

Several configuration options are exposed via environment variables:

  • PORT: controls which port the app will be served from.
  • BASE_URL: allows the app to be served from somewhere other than the server root. This affects asset and API routes, websocket endpoints, generated links, and more. Note that for this to work effectively, the app must still receive the base URL as part of the request; this is important if the app is reverse-proxied behind Apache. For instance, if the queue is served from /my/path/, then you should run with BASE_URL=/my/path (note the lack of trailing slash), and a request for queue 1 should be received as /my/path/queue/1.

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.