express: serve up the frontend js asset
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
44167de812
commit
094465b9a7
3 changed files with 89 additions and 87 deletions
|
@ -18,7 +18,6 @@ const db = new sqlite3.Database('mydb.db', (err) => {
|
|||
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
time_difference INTEGER -- Add this column for time difference
|
||||
)
|
||||
|
||||
`);
|
||||
}
|
||||
});
|
||||
|
@ -29,6 +28,9 @@ app.use(bodyParser.json());
|
|||
app.get('/', (req, res) => {
|
||||
res.sendFile(__dirname + '/index.html');
|
||||
});
|
||||
app.get('/asset/frontend.js', (req, res) => {
|
||||
res.sendFile(__dirname + '/asset/frontend.js');
|
||||
});
|
||||
|
||||
// Route to get a random animal name
|
||||
app.get('/getRandomAnimal', async (req, res) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue