16 lines
357 B
JavaScript
16 lines
357 B
JavaScript
const express = require('express');
|
|
const path = require('path');
|
|
const handleSearch = require('./search');
|
|
|
|
const app = express();
|
|
const port = 3000;
|
|
|
|
app.get('/', (req, res) => {
|
|
res.sendFile(path.join(__dirname, '/static/index.html'));
|
|
});
|
|
|
|
app.get('/search', handleSearch);
|
|
|
|
app.listen(port, () => {
|
|
console.log(`App listening on port ${port}`);
|
|
}); |