UNPKG

visual-route

Version:

A simple package to visualize routes and distances using OpenRouteService API.

21 lines (16 loc) 523 B
import express from 'express'; import path from 'path'; import dotenv from 'dotenv'; dotenv.config(); const app = express(); const port = 3000; // Serve static files from the 'example' folder app.use(express.static(path.join(process.cwd(), 'example'))); // API route to send the ORS API key app.get('/api/getApiKey', (req, res) => { res.json({ apiKey: process.env.ORS_API_KEY }); }); // Start the server app.listen(port, () => { console.log(`Server is running at http://localhost:${port}`); });