A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.
GraphQL Playground http://localhost:3000/graphql
HTTP HEADERS
{
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZXhhbXBsZS5jb20iLCJzdWIiOiI4Njc0MmNkNy02MDhhLWYzNzItZTRlNy1lZjBhMmVhMjNmYzciLCJpYXQiOjE2NjI0NDg0MjQsImV4cCI6MTY2MjQ1MjAyNH0.m0nLK9XGuXArn-v3vsbCXPXzgr3QnL5cUkZMTu9Gn3M"
}
mutation {
login(
loginInput: {
email: "[email protected]",
password: "password12345"
}
) {
developer {
email
joinedProducts {
productId
product {
id
}
}
},
accessToken
}
}
query {
developer(id: "86742cd7-608a-f372-e4e7-ef0a2ea23fc7") {
id
email
joinedProducts {
productId
product {
id
}
}
}
talker(id: "1") {
id
name
joinedRooms {
joinedMessageOrder
readMessageOrder
room {
id
name
joinedTalkers {
joinedMessageOrder
readMessageOrder
talker {
id
}
}
}
}
}
}
mutation {
createDeveloper(
data: {
email: "[email protected]"
password: "password1234"
}
) {
email
}
}
mutation {
updateDeveloper(
data: {
id: "86742cd7-608a-f372-e4e7-ef0a2ea23fc7",
email: "[email protected]"
}
) {
email
}
}
subscription {
developerUpdated(id: "86742cd7-608a-f372-e4e7-ef0a2ea23fc7") {
id
email
}
}
npx prisma studio
npx prisma db seed
Properties defined in .env are merged into environment variables.
.env
NODE_ENV="development"
Once you have defined the new environment variables, add the code to the following file.
src/global.d.ts
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
}
}
src/app.module.ts
@Module({
imports: [
ConfigModule.forRoot({
validationSchema: Joi.object({
NODE_ENV: Joi.string()
.valid('development', 'production', 'test')
.required(),
}),
}),
docker-compose exec postgres psql -U root -d chat-compo -c "CREATE DATABASE \"chat-compo-test\""
Prism references .env
, so copy .env.test
to .env
and run the command.
npx prisma migrate deploy