Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw92
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Болатов Ален
hw92
Commits
11ef6884
Commit
11ef6884
authored
Apr 01, 2023
by
Рахметова Альбина
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5' into 'dev'
5 See merge request
!5
parents
0080957a
3672353c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
94 deletions
+142
-94
.env
backend/.env
+2
-0
index.ts
backend/src/index.ts
+17
-0
mongoose.ts
backend/src/repository/mongoose.ts
+19
-0
environment.d.ts
backend/src/types/environment.d.ts
+10
-0
tsconfig.json
backend/tsconfig.json
+94
-94
No files found.
backend/.env
0 → 100644
View file @
11ef6884
MONGO_URL='mongodb://localhost:27017'
PORT='3000'
\ No newline at end of file
backend/src/index.ts
0 → 100644
View file @
11ef6884
import
express
,
{
Express
,
json
,
urlencoded
}
from
'express'
;
import
'dotenv/config'
;
import
cors
from
'cors'
;
import
{
mongoose
}
from
'./repository/mongoose'
;
mongoose
.
run
();
const
app
:
Express
=
express
();
app
.
use
(
json
());
app
.
use
(
cors
());
app
.
use
(
urlencoded
({
extended
:
true
}));
app
.
use
(
express
.
static
(
'public/uploads'
));
app
.
listen
(
process
.
env
.
PORT
,
()
=>
{
console
.
log
(
`App started on port
${
process
.
env
.
PORT
}
`
);
});
backend/src/repository/mongoose.ts
0 → 100644
View file @
11ef6884
import
{
connect
,
connection
}
from
'mongoose'
;
export
const
mongoose
=
{
run
:
async
()
=>
{
try
{
return
await
connect
(
`
${
process
.
env
.
MONGO_URL
}
/hw92`
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
stop
:
async
()
=>
{
try
{
return
await
connection
.
destroy
();
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
};
backend/src/types/environment.d.ts
0 → 100644
View file @
11ef6884
declare
global
{
namespace
NodeJS
{
interface
ProcessEnv
{
PORT
:
string
;
MONGO_URL
:
string
;
}
}
}
export
{};
backend/tsconfig.json
View file @
11ef6884
...
...
@@ -11,7 +11,7 @@
//
"disableReferencedProjectLoad"
:
true
,
/*
Reduce
the
number
of
projects
loaded
automatically
by
TypeScript.
*/
/*
Language
and
Environment
*/
"target"
:
"es2020"
,
/*
Set
the
JavaScript
language
version
for
emitted
JavaScript
and
include
compatible
library
declarations.
*/
"target"
:
"es2020"
/*
Set
the
JavaScript
language
version
for
emitted
JavaScript
and
include
compatible
library
declarations.
*/
,
//
"lib"
:
[],
/*
Specify
a
set
of
bundled
library
declaration
files
that
describe
the
target
runtime
environment.
*/
//
"jsx"
:
"preserve"
,
/*
Specify
what
JSX
code
is
generated.
*/
//
"experimentalDecorators"
:
true
,
/*
Enable
experimental
support
for
TC
39
stage
2
draft
decorators.
*/
...
...
@@ -25,9 +25,9 @@
//
"moduleDetection"
:
"auto"
,
/*
Control
what
method
is
used
to
detect
module-format
JS
files.
*/
/*
Modules
*/
"module"
:
"NodeNext"
,
/*
Specify
what
module
code
is
generated.
*/
"module"
:
"NodeNext"
/*
Specify
what
module
code
is
generated.
*/
,
//
"rootDir"
:
"./"
,
/*
Specify
the
root
folder
within
your
source
files.
*/
"moduleResolution"
:
"NodeNext"
,
/*
Specify
how
TypeScript
looks
up
a
file
from
a
given
module
specifier.
*/
"moduleResolution"
:
"NodeNext"
/*
Specify
how
TypeScript
looks
up
a
file
from
a
given
module
specifier.
*/
,
//
"baseUrl"
:
"./"
,
/*
Specify
the
base
directory
to
resolve
non-relative
module
names.
*/
//
"paths"
:
{},
/*
Specify
a
set
of
entries
that
re-map
imports
to
additional
lookup
locations.
*/
//
"rootDirs"
:
[],
/*
Allow
multiple
folders
to
be
treated
as
one
when
resolving
modules.
*/
...
...
@@ -49,7 +49,7 @@
//
"emitDeclarationOnly"
:
true
,
/*
Only
output
d.ts
files
and
not
JavaScript
files.
*/
//
"sourceMap"
:
true
,
/*
Create
source
map
files
for
emitted
JavaScript
files.
*/
//
"outFile"
:
"./"
,
/*
Specify
a
file
that
bundles
all
outputs
into
one
JavaScript
file.
If
'declaration'
is
true
,
also
designates
a
file
that
bundles
all
.d.ts
output.
*/
"outDir"
:
"dist"
,
/*
Specify
an
output
folder
for
all
emitted
files.
*/
"outDir"
:
"dist"
/*
Specify
an
output
folder
for
all
emitted
files.
*/
,
//
"removeComments"
:
true
,
/*
Disable
emitting
comments.
*/
//
"noEmit"
:
true
,
/*
Disable
emitting
files
from
a
compilation.
*/
//
"importHelpers"
:
true
,
/*
Allow
importing
helper
functions
from
tslib
once
per
project
,
instead
of
including
them
per-file.
*/
...
...
@@ -71,12 +71,12 @@
/*
Interop
Constraints
*/
//
"isolatedModules"
:
true
,
/*
Ensure
that
each
file
can
be
safely
transpiled
without
relying
on
other
imports.
*/
//
"allowSyntheticDefaultImports"
:
true
,
/*
Allow
'import
x
from
y'
when
a
module
doesn't
have
a
default
export.
*/
"esModuleInterop"
:
true
,
/*
Emit
additional
JavaScript
to
ease
support
for
importing
CommonJS
modules.
This
enables
'allowSyntheticDefaultImports'
for
type
compatibility.
*/
"esModuleInterop"
:
true
/*
Emit
additional
JavaScript
to
ease
support
for
importing
CommonJS
modules.
This
enables
'allowSyntheticDefaultImports'
for
type
compatibility.
*/
,
//
"preserveSymlinks"
:
true
,
/*
Disable
resolving
symlinks
to
their
realpath.
This
correlates
to
the
same
flag
in
node.
*/
"forceConsistentCasingInFileNames"
:
true
,
/*
Ensure
that
casing
is
correct
in
imports.
*/
"forceConsistentCasingInFileNames"
:
true
/*
Ensure
that
casing
is
correct
in
imports.
*/
,
/*
Type
Checking
*/
"strict"
:
true
,
/*
Enable
all
strict
type-checking
options.
*/
"strict"
:
true
/*
Enable
all
strict
type-checking
options.
*/
,
//
"noImplicitAny"
:
true
,
/*
Enable
error
reporting
for
expressions
and
declarations
with
an
implied
'any'
type.
*/
//
"strictNullChecks"
:
true
,
/*
When
type
checking
,
take
into
account
'
null
'
and
'undefined'.
*/
//
"strictFunctionTypes"
:
true
,
/*
When
assigning
functions
,
check
to
ensure
parameters
and
the
return
values
are
subtype-compatible.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment