Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Aptyaa committed Mar 10, 2024
1 parent 2a26814 commit 95a8a14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
35 changes: 28 additions & 7 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
import express from 'express'
// import express from 'express'

const PORT = 3000
const app = express()
app.use(express.static('./dist'))
// const PORT = 3000
// const app = express()
// app.use(express.static('./dist'))

app.listen(PORT, () => {
console.log(`Server works on ${PORT}`)
})
// app.listen(PORT, () => {
// console.log(`Server works on ${PORT}`)
// })

import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';

const app = express();
const PORT = 3000;

const filename = fileURLToPath(import.meta.url);

const dirname = path.dirname(filename);

app.use(express.static(path.join(dirname, 'dist')));

app.get('/*', (req, res) => {
res.sendFile('index.html', { root: path.join(dirname, 'dist') });
});

app.listen(PORT, function () {
console.log(`Сервер запущен на ${PORT} порте`);
});
1 change: 0 additions & 1 deletion src/utils/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class Router {
this.currentRoute = route!;

if (!['/', '/sign-up', '/404', '/500'].find(el => el === pathname)) {
console.log('query');
AuthController.fetchUser()
.then(() => {
if (pathname === '/messenger') {
Expand Down

0 comments on commit 95a8a14

Please sign in to comment.