https://github.com/symonmuchemi/express
This repository contains API's I have developed using express.
https://github.com/symonmuchemi/express
express postgresql prisma typescript xata-io
Last synced: 2 months ago
JSON representation
This repository contains API's I have developed using express.
- Host: GitHub
- URL: https://github.com/symonmuchemi/express
- Owner: SymonMuchemi
- Created: 2024-10-09T07:59:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T16:04:13.000Z (over 1 year ago)
- Last Synced: 2024-10-20T04:00:57.888Z (over 1 year ago)
- Topics: express, postgresql, prisma, typescript, xata-io
- Language: TypeScript
- Homepage:
- Size: 6.34 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express
## Installation
To install Express, you need to have Node.js and npm installed. If you don't have them installed, you can download and install them from the official website: [Node.js](https://nodejs.org/).
To install Express, run the following commands:
1. Create a directory for your project:
```bash
mkdir my-express-app
cd my-express-app
```
1. Initialize a new Node.js project:
```bash
npm init -y
```
1. Install Express:
```bash
npm install express
```
## Hello World Example
Create a file named `app.js` and add the following code to set up a basic Express server with a "Hello World" route:
```javascript
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});
```
To run the server, use the following command:
```bash
node app.js
```
You should see the message `Example app listening at http://localhost:3000` in your terminal. Open your browser and navigate to `http://localhost:3000` to see the "Hello World!" message.