Express.js

{{Use dmy dates|date=April 2022}}

{{Short description|JavaScript framework}}

{{Infobox software

| name = Express.js

| logo = Expressjs.png

| author = TJ Holowaychuk

| developer = OpenJS Foundation and others

| released = {{start date and age|df=yes|2010|11|16}}

| latest release version = {{wikidata|property|P348}}

| latest release date = {{wikidata|qualifier|mdy|P348|P577}}; {{time ago|{{wikidata|qualifier|raw|P348|P577}}}}{{wikidata|reference|mdy|edit|P348}}

| platform = Node.js

| programming language = JavaScript

| license = MIT License

| genre = Web framework

}}

Express.js, or simply Express, is a back end web application framework for building RESTful APIs with Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs.{{cite web |url=https://expressjs.com |title=Express.js home page}} It has been called the de facto standard server framework for Node.js.[https://venturebeat.com/2012/01/07/building-consumer-apps-with-node/ Case study: How & why to build a consumer app with Node.js]. VentureBeat.com.

The original author, TJ Holowaychuk, described it as a Sinatra-inspired server,{{cite web |first=TJ |last=Holowaychuck |url=http://tjholowaychuk.tumblr.com/post/820103177/express-1-0beta |archive-url=https://web.archive.org/web/20150706050636/https://tjholowaychuk.tumblr.com/post/820103177/express-1-0beta |archive-date=2015-07-06 |title=Express 1.0beta}} meaning that it is relatively minimal with many features available as plugins. Express is the back-end component of popular development stacks like the MEAN, MERN or MEVN stack, together with the MongoDB database software and a JavaScript front-end framework or library.{{cite web |url=http://mean.io |title=Mean.io: The Friendly & Fun Javascript Fullstack for your next web application |archive-date=13 June 2019 |url-status=dead |archive-url=https://web.archive.org/web/20190613011437/http://mean.io/ |access-date=15 July 2019}}

History

Express.js was founded by TJ Holowaychuk. The first release, according to Express.js's GitHub repository, was on 22 May 2010. Version 0.12

In June 2014, rights to manage the project were acquired by StrongLoop.{{cite web |title=TJ Holowaychuk Passes Sponsorship of Express to StrongLoop |url=https://strongloop.com/strongblog/tj-holowaychuk-sponsorship-of-express/ |publisher=StrongLoop |access-date=11 February 2016 |url-status=dead |archive-url=https://web.archive.org/web/20161011091052/https://strongloop.com/strongblog/tj-holowaychuk-sponsorship-of-express/ |archive-date=11 October 2016}} StrongLoop was acquired by IBM in September 2015;{{cite web |title=IBM snaps up StrongLoop to add Node.js smarts to BlueMix |url=http://www.infoworld.com/article/2982876/javascript/ibm-snaps-up-strongloop-to-add-nodejs-smarts-to-bluemix.html |website=Infoworld |date=10 September 2015 |publisher=IDG |access-date=11 February 2016}} in January 2016, IBM announced that it would place Express.js under the stewardship of the Node.js Foundation incubator.{{cite web |title=Node.js Foundation to shepherd Express Web framework |url=http://www.infoworld.com/article/3031686/javascript/nodejs-foundation-to-shepherd-express-web-framework.html |website=Infoworld |date=10 February 2016 |publisher=IDG |access-date=11 February 2016}}

Features

Popularity

Express.js is used by Fox Sports, PayPal, Uber and IBM.{{cite web |url=https://expressjs.com/en/resources/companies-using-express.html |title=Companies using Express |website=expressjs.com |language=en |access-date=2018-12-04}}

Example

The following program will respond to HTTP GET requests with the text 'Hi, your request has been received', and listen to the port the program is running on (in this case, port 2000).

// Importing the Express library.

const express = require('express');

// Initializing the app.

const app = express();

// Getting the path request and sending the response with text.

app.get('/', (req, res) => {

res.send('Hi, your request has been received');

});

// Listening on port 2000.

app.listen(2000, () => {

console.log('listening at http://localhost:2000');

});

See also

{{Portal|Free and open-source software}}

References

{{Reflist}}