Skip to content

ziaq/static-assets-server

Repository files navigation

Description

The server distributing static content also handles the upload of new static files and performs the deletion of sparklines triggered by the sparklines-generator.

In the current implementation, it is crucial to limit API endpoint access to the local network only, thereby preventing any external network requests. Nginx can be used as one possible method to enforce this restriction.

Server Launch Guide

Step 1: Clone the repository

Step 2: Install dependencies

Navigate to the project directory and run the following command to install all necessary dependencies:

npm  install

Step 3: Configure the environment

Create a '.env' file in the root directory of the project using the following template:

# .env file

SERVER_IP=127.0.0.1

SERVER_PORT=5000

TELEGRAM_BOT_TOKEN=''  # Enter your Telegram bot token here

ERROR_ALERT_CHANNEL_ID=''  # Telegram channel ID for error notifications

CORS_ORIGIN_URL=http://localhost:3000  # URL for CORS origin

Step 4: Run server

Run the following command to start the server:

npm  start

Upon successful startup, the console will display a message indicating that the server is running. This message will reflect the IP address and port specified in your .env file. For example:

Server  is  running  on  127.0.0.1:5000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published