title | description | tags | |||||
---|---|---|---|---|---|---|---|
ExpressJs server |
An express server with common examples |
|
This example starts an Express JS server.
- Install dependencies
npm install
- Start the development server
npm run dev
The server started returns a plaintext message for the /
route and a json message for the /json
route.
The main application code is located in index.js
.
you should read the comments in the code to understand what is happening. check out the expressjs documentation for more information. also, if this is your first time doing express, you should read the files in the order listed below.
src
contains the source code for the serversrc/routes
contains the routes for the serversrc/routes/router_example.js
contains examples pertaining to expressjs routers