Example of creating an RESTful API using Node.js, TypeScript, Restify, and Mongodb.
- Server: Node.js with Restify.
- Language: TypeScript 3.3.
- Database: Mongodb with Mongoose.
- JWT.
- HATEOAS.
- Jest.
# Clone the repository
git clone [email protected]:pinceladasdaweb/restify-api.git myproject
cd myproject
# Install dependencies
npm install
# Start server
# Uses nodemon to watch for changes to Typescript source files
npm start
The server will connect to a database: mongodb://localhost/meat-api
.
This setting can be changed in the src/common/environment.ts
file.
export const environment = {
server: { port: process.env.SERVER_PORT || 3000 },
db: { url: process.env.DB_URL || 'mongodb://localhost/meat-api' },
security: {
saltRounds: process.env.SALT_ROUNDS || 10,
apiSecret: process.env.API_SECRET || 'meat-api-secret'
},
log: {
name: 'meat-api-logger',
level: process.env.LOG_LEVEL || 'debug'
}
}
Check CONTRIBUTING.md for more information.
Check Releases for detailed changelog.