You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
422 B
JavaScript

1 month ago
import 'dotenv/config'
import express from 'express'
const app = express()
const port = process.env.PORT || 3000
1 month ago
import WeatherScraper from './weatherScraper.js'
const scraper = new WeatherScraper()
await scraper.init()
setInterval(() => scraper.fetch(), 1000 * 60 * 5)
1 month ago
app.get('/', (req, res) => {
res.json(scraper.data)
})
1 month ago
app.listen(port, () => {
console.log(`Weather Scraper listening on port ${port}`)
})